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/48470] ICE in expand_expr_addr_expr_1 at expr.c:6835


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

--- Comment #3 from Stephen Cleary <gcc.ourteddybear at xoxy dot net> 2011-07-26 15:56:40 UTC ---
(In reply to comment #2)
> The test case reduces to the following:
> void __attribute__((naked)) f(void)
> {
>     int x = 0;
>     g(&x);
> }
> It ICEs 4.4.5, 4.5.2, and 4.6.0, but not 4.3.5, 4.2.4, or 4.1.2.
> I suspect it isn't valid to make recursive calls or take the address of local
> variables in naked functions.

It is important to note, however, that the original test case does not take the
address of a local variable in a naked function. The original test case is like
this:

static void g(void);
void __attribute__((naked)) f(void)
{
    g();
}
void g(void)
{
    int x = 0;
    h(&x);
}

So this may be due to overzealous inlining.


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