I get an ICE on PowerPC with the following code on a gcc svn checkout from this morning: gcc version 4.4.0 20080909 (experimental) (GCC) # /root/gcc-installed/bin/g++ -O -ffast-math -c foo.cpp foo.cpp: In member function ‘void testcase::foo::doit(double, double, double)’: foo.cpp:16: error: control flow in the middle of basic block 3 foo.cpp:16: error: control flow in the middle of basic block 3 foo.cpp:16: error: BB 3 can not throw but has EH edges foo.cpp:16: internal compiler error: verify_flow_info failed It compiles OK if the -ffast-math flag is not specified.
Created attachment 16280 [details] Testcase
I get the same on x86_64.
Here is a reduced testcase without -ffast-math (aka it also applies to integers :) ): int zot(int ); struct bar { ~bar() { } }; int x; void doit(int a, int b, int c) { bar pn; int b1 = zot(a) * c; int b2 = zot(b) * c; x = b1 + b2; }
This is caused by PR15255 fix, undistribute_ops_list -> build_and_add_sum happily appends new statements after a throwing statement.
Mine then.
Fixed.
Subject: Bug 37456 Author: rguenth Date: Thu Sep 18 11:28:18 2008 New Revision: 140449 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=140449 Log: 2008-09-18 Richard Guenther <rguenther@suse.de> PR tree-optimization/37456 * tree-ssa-reassoc.c (build_and_add_sum): If the stmt we want to insert after ends a BB insert on the single fallthru outgoing edge. * testsuite/g++.dg/torture/pr37456.C: New testcase. Added: trunk/gcc/testsuite/g++.dg/torture/pr37456.C Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-ssa-reassoc.c