http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60340
Bug ID: 60340 Summary: ICE on valid code with -fcheck-data-deps at -O1 and above on x86_64-linux-gnu Product: gcc Version: 4.9.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 by the current gcc trunk with -fcheck-data-deps at -O1 and above on x86_64-linux-gnu (in both 32-bit and 64-bit modes). It also affects 4.7.x and 4.8.x, but not 4.6.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/4.9.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 4.9.0 20140225 (experimental) [trunk revision 208111] (GCC) $ $ gcc-trunk -O1 -c small.c $ gcc-trunk -O0 -fcheck-data-deps -c small.c $ gcc-4.6.4 -O1 -fcheck-data-deps -c small.c $ $ gcc-trunk -O1 -fcheck-data-deps -c small.c (Number of distance vectors differ: Banerjee has 1, Omega has 2. Banerjee dist vectors: 0 Omega dist vectors: 0 1 data dependence relation: (Data Dep: #(Data Ref: # bb: 4 # stmt: a.0_4 ={v} a; # ref: a # base_object: MEM[(int *)&a]; #) #(Data Ref: # bb: 4 # stmt: a ={v} a.1_5; # ref: a # base_object: MEM[(int *)&a]; #) inner loop index: 0 loop nest: (1 ) distance_vector: 0 distance_vector: 1 direction_vector: = direction_vector: + ) ) small.c: In function ‘foo’: small.c:3:6: internal compiler error: in compute_affine_dependence, at tree-data-ref.c:4233 void foo () ^ 0xf187fb compute_affine_dependence(data_dependence_relation*, loop*) ../../gcc-trunk/gcc/tree-data-ref.c:4232 0xf1908a compute_all_dependences(vec<data_reference*, va_heap, vl_ptr>, vec<data_dependence_relation*, va_heap, vl_ptr>*, vec<loop*, va_heap, vl_ptr>, bool) ../../gcc-trunk/gcc/tree-data-ref.c:4304 0xf19a20 compute_data_dependences_for_loop(loop*, bool, vec<loop*, va_heap, vl_ptr>*, vec<data_reference*, va_heap, vl_ptr>*, vec<data_dependence_relation*, va_heap, vl_ptr>*) ../../gcc-trunk/gcc/tree-data-ref.c:4632 0xf19b0e analyze_all_data_dependences ../../gcc-trunk/gcc/tree-data-ref.c:4740 0xf19b0e tree_check_data_deps() ../../gcc-trunk/gcc/tree-data-ref.c:4787 0xaa51c7 check_data_deps ../../gcc-trunk/gcc/tree-ssa-loop.c:209 0xaa51c7 execute ../../gcc-trunk/gcc/tree-ssa-loop.c:245 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. $ ------------------------- volatile int a; void foo () { for (; a < 1; a++) ; }