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