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



             Bug #: 54666

           Summary: when do lto opitimizing with attribute (weak,alias),

                    it will produce wrong code

    Classification: Unclassified

           Product: gcc

           Version: lto

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: c

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: hcj20080...@163.com





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();

Reply via email to