Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

[MSP430] Fix for byval parameters #14130

Open Quuxplusone opened 11 years ago

Quuxplusone commented 11 years ago
Bugzilla Link PR14096
Status NEW
Importance P enhancement
Reported by Job Noorman (jobnoorman@gmail.com)
Reported on 2012-10-16 07:56:37 -0700
Last modified on 2012-10-17 05:08:17 -0700
Version trunk
Hardware PC Linux
CC anton@korobeynikov.info, llvm-bugs@lists.llvm.org, pawel@32bitmicro.com
Fixed by commit(s)
Attachments byval.diff (3959 bytes, text/plain)
byval.diff (4812 bytes, text/plain)
Blocks
Blocked by
See also
Created attachment 9356
Patch

I noticed that the 'byval' parameter attribute is ignored in the MSP430
backend. This causes functions that take a struct as argument to miscompile.
Specifically, structs that should be passed by value are passed as a pointer
instead.

I have attached a simple patch that addresses this problem.
Quuxplusone commented 11 years ago

Attached byval.diff (3959 bytes, text/plain): Patch

Quuxplusone commented 11 years ago

Attached byval.diff (4812 bytes, text/plain): Patch including testcase