[Bug target/41246] should "sorry" when regparm=3 and nested functions are encountered
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Thu Sep 3 18:05:00 GMT 2009
------- Comment #12 from pinskia at gcc dot gnu dot org 2009-09-03 18:05 -------
(In reply to comment #11)
> Subject: Re: should "sorry" when regparm=3 and nested functions are
> encountered
>
> All,
>
> nested functions get passed a hidden argumment akin to static link/display
> so that nested function can access the locals of its enclosing function.
>
> Passing a nested function as parameter to another function isn't going
> to work correctly when the function is eventually called the
> hidden argument isn't going to be setup correctly.
>
> I think the code is thus invalid and GCC should reject it.
It is valid as GCC creates a trampoline for the function pointer ...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41246
More information about the Gcc-bugs
mailing list