https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64493

            Bug ID: 64493
           Summary: ICE at -O3 on x86_64-linux-gnu
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu

The following code causes an ICE when compiled with the current gcc trunk at
-O3 on x86_64-linux-gnu in both 32-bit and 64-bit modes. 

It is a regression from 4.9.x.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/5.0.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 5.0.0 20150104 (experimental) [trunk revision 219172] (GCC) 

$ 
$ gcc-trunk -O2 small.c; a.out
$ gcc-4.9 -O3 small.c; a.out
$ 
$ gcc-trunk -O3 small.c
small.c: In function ‘main’:
small.c:6:1: error: definition in block 13 does not dominate use in block 12
 main ()
 ^
for SSA_NAME: vect_c.29_53 in statement:
vect_e.35_1 = vect_c.29_53 | vect_e.35_18;
small.c:6:1: internal compiler error: verify_ssa failed
0xc8c6b1 verify_ssa(bool, bool)
    ../../gcc-trunk/gcc/tree-ssa.c:1062
0x9daae5 execute_function_todo
    ../../gcc-trunk/gcc/passes.c:1947
0x9db523 execute_todo
    ../../gcc-trunk/gcc/passes.c:1997
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.
$ 


------------------------------


#include <assert.h>

int a, b, c, d, e, f, g, h;

int
main ()
{
  for (; a; a--)
    for (d = 1; d <= 0; d++)
      for (; d;)
    if (h)
      {
        assert (g);
        assert (0);
      }

  for (f = 4; f; f--)
    {
      for (b = 0; b < 2; b++)
    c |= 1;
      e |= c;
    }

  return 0;
}

Reply via email to