This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/48470] ICE in expand_expr_addr_expr_1 at expr.c:6835
- From: "gcc.ourteddybear at xoxy dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 26 Jul 2011 15:56:57 +0000
- Subject: [Bug middle-end/48470] ICE in expand_expr_addr_expr_1 at expr.c:6835
- Auto-submitted: auto-generated
- References: <bug-48470-4@http.gcc.gnu.org/bugzilla/>
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.