Created attachment 30289 [details] gzipped C source code The attached source code causes the following crash on gcc-4.9 trunk dated 20130605 on an AMD x86_64 box when compiled with -O3. Unable to coalesce ssa_names 45 and 3671 which are marked as MUST COALESCE. sp_45(ab) and sp_3671(ab) In file included from vm.c:661:0: vm-engine.c: In function ‘vm_debug_engine’: vm-engine.c:39:1: internal compiler error: SSA corruption 0x9ca5bf fail_abnormal_edge_coalesce ../../src/trunk/gcc/tree-ssa-coalesce.c:898 0x9ca5bf coalesce_partitions ../../src/trunk/gcc/tree-ssa-coalesce.c:1200 0x9ca5bf coalesce_ssa_name() ../../src/trunk/gcc/tree-ssa-coalesce.c:1337 0x981cee remove_ssa_form ../../src/trunk/gcc/tree-outof-ssa.c:900 0x981cee rewrite_out_of_ssa(ssaexpand*) ../../src/trunk/gcc/tree-outof-ssa.c:1133 0x60c694 gimple_expand_cfg ../../src/trunk/gcc/cfgexpand.c:4541 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.
Confirmed, reducing.
Created attachment 30291 [details] autoreduced testcase Mine anyway.
It's the vectorizer, thus fails at -O -ftree-vectorize already.
niter analysis computes (((unsigned long) sp_35(ab) - (unsigned long) (sp_3(ab) + 8)) + 7) / 8)) which the vectorizer inserts, obviously breaking coalescing of sp_35 and sp_3. It's expand_simple_operations done in niter analysis that breaks this and I have a patch to fix that.
Author: rguenth Date: Thu Jun 20 10:22:33 2013 New Revision: 200237 URL: http://gcc.gnu.org/viewcvs?rev=200237&root=gcc&view=rev Log: 2013-06-20 Richard Biener <rguenther@suse.de> PR tree-optimization/57584 * tree-ssa-loop-niter.c (expand_simple_operations): Avoid including SSA names into the expanded expression that take part in abnormal coalescing. * gcc.dg/torture/pr57584.c: New testcase. Added: trunk/gcc/testsuite/gcc.dg/torture/pr57584.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-ssa-loop-niter.c