This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/12329] x86: local function declared with attribute((regparm(3))) gets corrupted parent frame pointer


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]