[Bug c++/56652] New: Wrong code in O2 - if in inline function

dominik.siatkowski at aldec dot com.pl gcc-bugzilla@gcc.gnu.org
Mon Mar 18 12:03:00 GMT 2013


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

             Bug #: 56652
           Summary: Wrong code in O2 - if in inline function
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: dominik.siatkowski@aldec.com.pl


Bug detected with gcc-4.7.2 on i386-linux-gnu

Attached example segfalts compiled with -O2 (or even with '-O1
-finline-small-functions -fstrict-overflow -ftree-vrp')
Works with -O1. Works also if compiled in one compilation unit.

Stepping thru code shows it enters
    if (count >= 0 && count < size)
in shift_right, where count is INT_MIN and size is 2.



More information about the Gcc-bugs mailing list