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 5.3.x. $ gcc-trunk -v Using built-in specs. COLLECT_GCC=gcc-trunk COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto --prefix=/usr/local/gcc-trunk --disable-bootstrap Thread model: posix gcc version 7.0.0 20160423 (experimental) [trunk revision 235384] (GCC) $ $ gcc-trunk -O2 -c small.c $ gcc-5.3 -O3 -c small.c $ $ gcc-trunk -O3 -c small.c small.c: In function ‘fn2’: small.c:17:1: internal compiler error: Segmentation fault fn2 () ^~~ 0xb6718f crash_signal ../../gcc-source-trunk/gcc/toplev.c:333 0x74e89c vec_safe_length<loop*, va_gc> ../../gcc-source-trunk/gcc/vec.h:524 0x74e89c loop_depth ../../gcc-source-trunk/gcc/cfgloop.h:444 0x74e89c flow_loop_nested_p(loop const*, loop const*) ../../gcc-source-trunk/gcc/cfgloop.c:64 0xdb7837 vect_is_simple_reduction ../../gcc-source-trunk/gcc/tree-vect-loop.c:2627 0xdb9011 vect_force_simple_reduction ../../gcc-source-trunk/gcc/tree-vect-loop.c:3026 0xdb9011 vect_analyze_scalar_cycles_1 ../../gcc-source-trunk/gcc/tree-vect-loop.c:865 0xdbc807 vect_analyze_scalar_cycles ../../gcc-source-trunk/gcc/tree-vect-loop.c:939 0xdbc807 vect_analyze_loop_2 ../../gcc-source-trunk/gcc/tree-vect-loop.c:1845 0xdbc807 vect_analyze_loop(loop*) ../../gcc-source-trunk/gcc/tree-vect-loop.c:2264 0xdd7611 vectorize_loops() ../../gcc-source-trunk/gcc/tree-vectorizer.c:532 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. $ $ ------------------------------------------ struct S { int f1; int f2; } a; int b, c, d, e; short f; int fn1 (int p1, unsigned p2) { return p1 + p2; } void fn2 () { struct S g; int h; for (; c; c++) for (f = -3; f < 3; f = fn1 (f, 8)) { a.f1 = e; if (b) a = g; else for (; h; h++) d = b; } }
Started with r235292.
Probably a latent issue.
Author: amker Date: Tue Apr 26 11:10:47 2016 New Revision: 235436 URL: https://gcc.gnu.org/viewcvs?rev=235436&root=gcc&view=rev Log: PR tree-optimization/70771 PR tree-optimization/70775 * tree-if-conv.c (if_convertible_phi_p): Remove check on special virtual PHI nodes. Delete parameter. (if_convertible_loop_p_1): Delete argument to above function. (predicate_all_scalar_phis): Delete code handling single-argument PHIs. (tree_if_conversion): Mark and update virtual SSA. gcc/testsuite/ChangeLog PR tree-optimization/70771 PR tree-optimization/70775 * gcc.dg/pr70771.c: New test. * gcc.dg/pr70771.c: New test. Added: trunk/gcc/testsuite/gcc.dg/pr70771.c trunk/gcc/testsuite/gcc.dg/pr70775.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-if-conv.c
Fixed?
Yes, fixed.