This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/12329] x86: local function declared with attribute((regparm(3))) gets corrupted parent frame pointer
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Jul 2004 02:51:32 -0000
- Subject: [Bug target/12329] x86: local function declared with attribute((regparm(3))) gets corrupted parent frame pointer
- References: <20030918135628.12329.jbeulich@novell.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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