gcc version is gcc4.7.1 host,build adn target is x86 i586 test case name: weak_0.c extern void abort(void); int foo =0 ; extern int bar __attribute__ ((weak,alias ("foo"))); int main(void) { /* if( &foo != &bar) { abort(); }*/ if ( &foo != &bar) abort(); return 0; } when compilating weaK_0.c with fllowing cmmand : i586-target-linux-gnu-gcc weak_0.c -flto -o weak run week expected result: return 0; actual result: abort();
Confirmed. 4.6.x segfaults for me.
This was fixed for GCC 5.1.0. The problem is the same as PR 32219 really.
(In reply to Andrew Pinski from comment #2) > This was fixed for GCC 5.1.0. The problem is the same as PR 32219 really. That is the patch which fixes PR 32219 fixed this one.