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



             Bug #: 55236

           Summary: [4.8 Regression] gcc.c-torture/execute/pr22493-1.c

                    FAILs with -fPIC

    Classification: Unclassified

           Product: gcc

           Version: 4.8.0

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: tree-optimization

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

        ReportedBy: zso...@seznam.cz





Created attachment 28631

  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28631

testcase (gcc.c-torture/execute/pr22493-1.c)



Output:

$ gcc -O2 -fPIC -fwrapv testcase.c

$ ./a.out 

Aborted



The problem seems to be that f() is optimised just to abort().

In the -fPIC case, f() is called, and the program aborts.

Without -fPIC, f() is not called, so the program doesn't abort - though the

body of f() is reduced to just abort() as well.



Tested revisions:

r193182 - FAIL

4.7 r191640 - OK

Reply via email to