This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug objc/36610] objc_msg_sendv is broken for targets which pass argument via registers
- From: "matz at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Feb 2009 11:32:01 -0000
- Subject: [Bug objc/36610] objc_msg_sendv is broken for targets which pass argument via registers
- References: <bug-36610-16372@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from matz at gcc dot gnu dot org 2009-02-12 11:32 -------
I don't think it's __builtin_apply which is wrong. It's rather how it is
used in libobjc. In particular register parameters are handled wrongly.
libobjc objc_msg_sendv() simply tries to overwrite the first two argument
slots returned by __builtin_apply_args (called in a different routine) with
those it really wants in there. It uses method_get_{first,next}_argument
for that which tries to use the argument pointer in that memory block.
But memory pointed to by that arg pointer only contains the args passed on
stack. Those passed in registers lie somewhere else (in the block returned
by builtin_apply_args, but behind the arg pointer), in register order (not
in argument order!).
So, overwriting the argument slots doesn't actually overwrite the data which
later is used in __builtin_apply --> boom.
Accordingly changing the summary.
--
matz at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|middle-end |objc
Summary|__builtin_apply is broken |objc_msg_sendv is broken for
|for targets which pass |targets which pass argument
|argument via registers |via registers
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36610