[Bug tree-optimization/56539] New: [4.6/4.7/4.8 Regression] ICE: verify_ssa failed: caused by -foptimize-sibling-calls

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Mar 5 16:23:00 GMT 2013


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

             Bug #: 56539
           Summary: [4.6/4.7/4.8 Regression] ICE: verify_ssa failed:
                    caused by -foptimize-sibling-calls
    Classification: Unclassified
           Product: gcc
           Version: 4.6.3
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, wrong-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: redi@gcc.gnu.org


short string2int( const char * buf, unsigned len )
{
    return (len > 1) ? ( buf[len-1] - '0' ) + (short)10 * string2int(buf,
len-1) : ( *buf - '0' );
}

#include <assert.h>

int main()
{
    assert( string2int("13", 2) == 13);
    return 0;
}


At -O2 this program fails the assertion with 4.6 and 4.7

A 4.8 build with --enable-checking gets an ICE in verify_ssa

$ ~/gcc/4.8/bin/gcc t.c -O2
t.c: In function 'string2int':
t.c:12:1: error: definition in block 3 follows the use
 }
 ^
for SSA_NAME: _15 in statement:
acc_tmp_17 = (short int) _15;
t.c:12:1: internal compiler error: verify_ssa failed
0xa57004 verify_ssa(bool)
        ../../gcc-4.8/gcc/tree-ssa.c:1049
0x83ea9e execute_function_todo
        ../../gcc-4.8/gcc/passes.c:1967
0x83f56c execute_todo
        ../../gcc-4.8/gcc/passes.c:1999
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


Using -fno-optimize-sibling-calls makes the bug go away for all versions.



More information about the Gcc-bugs mailing list