[Bug target/12329] x86: local function declared with attribute((regparm(3))) gets corrupted parent frame pointer
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Tue Jul 27 02:51:00 GMT 2004
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-07-27 02:51 -------
Basically we should reject attribute((regparm(3))) on nested functions.
Note we already do not put attribute((regparm(3))) on nested functions automatically:
/* Use register calling convention for local functions when possible. */
if (!TARGET_64BIT && !user_convention && decl
&& flag_unit_at_a_time && !profile_flag)
{
struct cgraph_local_info *i = cgraph_local_info (decl);
if (i && i->local)
{
/* We can't use regparm(3) for nested functions as these use
static chain pointer in third argument. */
if (DECL_CONTEXT (decl) && !DECL_NO_STATIC_CHAIN (decl))
regparm = 2;
else
regparm = 3;
}
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12329
More information about the Gcc-bugs
mailing list