http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48437
Summary: LTO crashes with block-local function declarations
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: lto
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
The following program:
int
test (void)
{
int f (void);
return 0;
}
int
main (void)
{
int f (void);
int test (void);
return test ();
}
crashes lto1 when compiled with "gcc -g -O -flto -fwhole-program".
What seems to happen is that the FUNCTION_DECL for "f" is added by the LTO
reader into the BLOCK_VARS list of both test and main, which causes its
DECL_CHAIN to be clobbered and the two lists to be cross-entangled. This in
turn causes an endless recursive descent in set_block_abstract_flags, resulting
in a stack overflow ...
Seen on 4.6.0 (ppc64) and current mainline (i386).