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 middle-end/23828] local calling convention not used when using -fwhole-program --combine


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-09-13 23:02 -------
(In reply to comment #4)
>    /* We can't use regparm(3) for nested functions as these use
>       static chain pointer in third argument.  */
>    if (local_regparm == 3 && DECL_CONTEXT (decl)
>        && !DECL_NO_STATIC_CHAIN (decl))
>           local_regparm = 2;

Instead of the above check, change it to:
if (local_regparm == 3 &&  DECL_STRUCT_FUNCTION (fn)->static_chain_decl)
  local_regparm = 2;

That should make it work and work better at that too because it would also help C++ functions which 
currently have the same issue.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23828


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