[Bug c++/48834] New: [4.7 Regression] -fno-exceptions causes wrong code generation on C++ code

zsojka at seznam dot cz gcc-bugzilla@gcc.gnu.org
Sat Apr 30 14:03:00 GMT 2011


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

           Summary: [4.7 Regression] -fno-exceptions causes wrong code
                    generation on C++ code
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zsojka@seznam.cz
                CC: jason@gcc.gnu.org
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu


Created attachment 24150
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24150
reduced testcase

Compiler flags:
$ g++ testcase.C -fno-exceptions

Output (simplified):
$ g++ testcase.C -fno-exceptions -Wall -W -g
testcase.C: In function 'int main()':
testcase.C:6:4: warning: unused variable 's' [-Wunused-variable]
testcase.C:6:15: warning: 's' is used uninitialized in this function
[-Wuninitialized]
$ valgrind -q ./a.out 
==17173== Use of uninitialised value of size 8
==17173==    at 0x40060C: S::S() (testcase.C:2)
==17173==    by 0x4005DE: main (testcase.C:6)
==17173== 
==17173== 
==17173== Process terminating with default action of signal 11 (SIGSEGV)
==17173==  Bad permissions for mapped region at address 0x4004D0
==17173==    at 0x40060C: S::S() (testcase.C:2)
==17173==    by 0x4005DE: main (testcase.C:6)
Segmentation fault

This seems to be a recent regression.

Tested revisions:
r173182 - fail
4.6 r173059 - OK



More information about the Gcc-bugs mailing list