[Bug tree-optimization/61438] New: ICE on valid code at -O3 on x86_64-linux-gnu in in loop_preheader_edge, at cfgloop.c:1668

su at cs dot ucdavis.edu gcc-bugzilla@gcc.gnu.org
Sat Jun 7 06:10:00 GMT 2014


            Bug ID: 61438
           Summary: ICE on valid code at -O3 on x86_64-linux-gnu in in
                    loop_preheader_edge, at cfgloop.c:1668
           Product: gcc
           Version: 4.10.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.
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 4.10.0 20140606 (experimental) [trunk revision 211322] (GCC) 
$ gcc-trunk -O2 small.c; a.out
$ gcc-4.9.0 -O3 small.c; a.out
$ gcc-trunk -O3 small.c
small.c: In function ‘foo’:
small.c:12:1: internal compiler error: in loop_preheader_edge, at
 foo ()
0x62e9ce loop_preheader_edge(loop const*)
0xa3a6e0 block_before_loop
0xa3a6e0 analyze_scalar_evolution(loop*, tree_node*)
0xa3b9ea analyze_scalar_evolution_in_loop
0xa3bb4f simple_iv(loop*, loop*, tree_node*, affine_iv*, bool)
0xae08a9 eliminate_dom_walker::before_dom_children(basic_block_def*)
0xe94927 dom_walker::walk(basic_block_def*)
0xadd372 eliminate
0xadd7c3 execute
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, c, **d, e, g;
static int b = 1;

  int f0;
} f;

foo ()
  int h, *i = &a;
  for (; e;)
      for (c = 0; c < 1; c++)
    for (; b;)
      for (;;)
      if (a)
          for (; f.f0; f.f0++)
          if (g)
      for (h = 0; h < 2; h++)
          i = *d;
          assert (i);
  assert (i);

main ()
  foo (); 
  return 0;

More information about the Gcc-bugs mailing list