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

           Summary: crash in vect_is_slp_reduction
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: rmansfi...@qnx.com
              Host: x86_64-linux-gnu
            Target: mips-unknown-linux-uclibc
             Build: x86_64-linux-gnu


$ cat ~/ice.i
static char func1(int si1, int si2) { }
static char func2() { }

struct S0
{
 int t;
};

int g;

struct S0 s0;

int 
foo (int arg)
{
  int *ptr = &g;
  int i, j;
  for (i = 0; i < 10; i += 1)
    {
      for (j = 0; j < 1; j += 1)
    {
      int k;
      if (arg)
        {
          int l;
          for (k = 1; arg < 10; arg = func2 ())
        {
          return l;
        }
        }
      *ptr = func1 ((func2 () && s0.t > *ptr), func2 ()) ^ s0.t;
    }
    }
}


$ ./xgcc -v
Using built-in specs.
COLLECT_GCC=./xgcc
Target: mips-unknown-linux-uclibc
Configured with: ../configure --target=mips-unknown-linux-uclibc
--prefix=/home/ryan/x-tools/mips-unknown-linux-uclibc
--with-sysroot=/home/ryan/x-tools/mips-unknown-linux-uclibc/mips-unknown-linux-uclibc/sys-root
--enable-languages=c++,lto --disable-multilib --with-float=soft
--enable-__cxa_atexit
--with-local-prefix=/home/ryan/x-tools/mips-unknown-linux-uclibc/mips-unknown-linux-uclibc/sys-root
--disable-nls --enable-threads=posix --enable-symvers=gnu --enable-c99
--enable-long-long --enable-target-optspace
Thread model: posix
$ ./xgcc -B. ~/ice.i -O3
/home/ryan/ice.i: In function 'foo':
/home/ryan/ice.i:14:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


Program received signal SIGSEGV, Segmentation fault.
0x0000000000980f22 in gimple_code (g=0x0) at ../../gcc/gimple.h:1098
1098      return g->gsbase.code;
(gdb) bt
#0  0x0000000000980f22 in gimple_code (g=0x0) at ../../gcc/gimple.h:1098
#1  0x00000000009875cc in vect_is_slp_reduction (loop_info=0x1206b50, 
    phi=0x7ffff6e12500, first_stmt=0x7ffff7f995d8)
    at ../../gcc/tree-vect-loop.c:1746
#2  0x0000000000989116 in vect_is_simple_reduction_1 (loop_info=0x1206b50, 
    phi=0x7ffff6e12500, check_reduction=1 '\001', 
    double_reduc=0x7fffffffde1e "", modify=1 '\001')
    at ../../gcc/tree-vect-loop.c:2203
#3  0x00000000009891e6 in vect_force_simple_reduction (loop_info=0x1206b50, 
    phi=0x7ffff6e12500, check_reduction=1 '\001', 
    double_reduc=0x7fffffffde1e "") at ../../gcc/tree-vect-loop.c:2236
#4  0x000000000098493a in vect_analyze_scalar_cycles_1 (loop_vinfo=0x1206b50, 
    loop=0x7ffff7ebeaa0) at ../../gcc/tree-vect-loop.c:521
#5  0x0000000000984af3 in vect_analyze_scalar_cycles (loop_vinfo=0x1206b50)
    at ../../gcc/tree-vect-loop.c:596
#6  0x0000000000986e7a in vect_analyze_loop_2 (loop_vinfo=0x1206b50)
    at ../../gcc/tree-vect-loop.c:1449
#7  0x00000000009872b0 in vect_analyze_loop (loop=0x7ffff7ebeaa0)
    at ../../gcc/tree-vect-loop.c:1601
#8  0x000000000099e49b in vectorize_loops () at ../../gcc/tree-vectorizer.c:199
#9  0x000000000076b951 in execute_one_pass (pass=0x1024640)
    at ../../gcc/passes.c:1556
#10 0x000000000076bc05 in execute_pass_list (pass=0x1024640)
    at ../../gcc/passes.c:1610
#11 0x000000000076bc17 in execute_pass_list (pass=0x1024460)
    at ../../gcc/passes.c:1611
#12 0x000000000076bc17 in execute_pass_list (pass=0x1023b60)
    at ../../gcc/passes.c:1611
#13 0x0000000000879178 in tree_rest_of_compilation (fndecl=0x7ffff7f9c200)
    at ../../gcc/tree-optimize.c:417
#14 0x0000000000a2d215 in cgraph_expand_function (node=0x7ffff7f9b250)
    at ../../gcc/cgraphunit.c:1630
#15 0x0000000000a2efea in cgraph_expand_all_functions ()
    at ../../gcc/cgraphunit.c:1689
#16 cgraph_optimize () at ../../gcc/cgraphunit.c:1952
#17 0x0000000000a2f58a in cgraph_finalize_compilation_unit ()
    at ../../gcc/cgraphunit.c:1126
#18 0x0000000000485f08 in c_write_global_declarations ()
    at ../../gcc/c-decl.c:9840
#19 0x000000000081751c in compile_file () at ../../gcc/toplev.c:586
#20 0x0000000000819604 in do_compile () at ../../gcc/toplev.c:1905
#21 0x000000000081976d in toplev_main (argc=5, argv=0x7fffffffe158)
    at ../../gcc/toplev.c:1977
#22 0x00007ffff718deff in __libc_start_main ()
   from /lib/x86_64-linux-gnu/libc.so.6
#23 0x000000000046a3b9 in _start ()

Reply via email to