[Bug rtl-optimization/66626] [4.9/5/6 Regression] gcc.dg/torture/stackalign/non-local-goto-5.c segfaults w/ -mregparm=3

hjl.tools at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Jul 1 13:02:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66626

--- Comment #10 from H.J. Lu <hjl.tools at gmail dot com> ---
There is also

      else if (ix86_function_regparm (fntype, fndecl) == 3) 
        {
          /* For regparm 3, we have no free call-clobbered registers in
             which to store the static chain.  In order to implement this,
             we have the trampoline push the static chain to the stack.
             However, we can't push a value below the return address when
             we call the nested function directly, so we have to use an
             alternate entry point.  For this we use ESI, and have the
             alternate entry point push ESI, so that things appear the
             same once we're executing the nested function.  */
          if (incoming_p)
            {
              if (fndecl == current_function_decl)
                ix86_static_chain_on_stack = true; 
              return gen_frame_mem (SImode,
                                    plus_constant (Pmode,
                                                   arg_pointer_rtx, -8)); 
            }
          regno = SI_REG;
        }



More information about the Gcc-bugs mailing list