This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/23828] local calling convention not used when using -fwhole-program --combine
- 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: 13 Sep 2005 23:02:19 -0000
- Subject: [Bug middle-end/23828] local calling convention not used when using -fwhole-program --combine
- References: <20050912014301.23828.dann@godzilla.ics.uci.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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