Bug 37456 - [4.4 Regression] ICE: verify_flow_info failed: control flow in the middle of basic block
Summary: [4.4 Regression] ICE: verify_flow_info failed: control flow in the middle of ...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: 4.4.0
Assignee: Richard Biener
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2008-09-10 07:32 UTC by Anton Blanchard
Modified: 2008-09-18 11:28 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-09-15 08:38:13


Attachments
Testcase (170 bytes, text/plain)
2008-09-10 07:35 UTC, Anton Blanchard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Blanchard 2008-09-10 07:32:45 UTC
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.
Comment 1 Anton Blanchard 2008-09-10 07:35:43 UTC
Created attachment 16280 [details]
Testcase
Comment 2 Martin Michlmayr 2008-09-10 10:26:17 UTC
I get the same on x86_64.
Comment 3 Andrew Pinski 2008-09-14 04:50:18 UTC
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;
}
Comment 4 Jakub Jelinek 2008-09-15 08:31:20 UTC
This is caused by PR15255 fix, undistribute_ops_list -> build_and_add_sum
happily appends new statements after a throwing statement.
Comment 5 Richard Biener 2008-09-15 08:38:13 UTC
Mine then.
Comment 6 Richard Biener 2008-09-18 11:28:29 UTC
Fixed.
Comment 7 Richard Biener 2008-09-18 11:29:40 UTC
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