Bug 47632 - [4.6 Regression] ICE: verify_flow_info failed: BB 4 can not throw but has an EH edge with -fnon-call-exceptions -ftrapv and operator new[]
Summary: [4.6 Regression] ICE: verify_flow_info failed: BB 4 can not throw but has an ...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: 4.6.0
Assignee: Richard Biener
URL:
Keywords: ice-on-valid-code
: 47640 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-02-07 12:54 UTC by Zdenek Sojka
Modified: 2011-02-08 14:45 UTC (History)
0 users

See Also:
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Build:
Known to work: 4.5.0
Known to fail: 4.6.0
Last reconfirmed: 2011-02-07 16:01:01


Attachments
reduced testcase (115 bytes, text/plain)
2011-02-07 12:54 UTC, Zdenek Sojka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Sojka 2011-02-07 12:54:25 UTC
Created attachment 23264 [details]
reduced testcase

Compiler output:
$ gcc -O -fnon-call-exceptions -ftrapv testcase.C 
testcase.C: In function 'void foo(S<char>*)':
testcase.C:11:1: error: BB 4 can not throw but has an EH edge
testcase.C:11:1: internal compiler error: verify_flow_info failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Tested revisions:
r169824 - crash
r160000 - OK
Comment 1 Richard Biener 2011-02-07 16:01:01 UTC
Mine.  It's forwprop not cleaning up EH.
Comment 2 Richard Biener 2011-02-07 16:20:17 UTC
We propagate D.2112_13 into the if, changing that to D.2112_22 != 0 and
remove the D.2112_13 def w/o cleaning up EH.

  [LP 1] D.2112_13 = D.2112_22 + -1;
  goto <bb 6>;
  # SUCC: 6 [100.0%]  (fallthru,exec) 5 (eh,exec)

...

  # BLOCK 6 freq:9700
  # PRED: 4 [100.0%]  (fallthru,exec)
  ivtmp.8_12 = ivtmp.8_14 - 1;
  if (D.2112_13 != -1)
Comment 3 Richard Biener 2011-02-08 10:44:12 UTC
Author: rguenth
Date: Tue Feb  8 10:44:06 2011
New Revision: 169917

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=169917
Log:
2011-02-08  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/47632
	* tree-ssa-forwprop.c (remove_prop_source_from_use): Remove
	unused up_to_stmt parameter, return whether cfg-cleanup is
	necessary, remove EH info properly.
	(forward_propagate_into_gimple_cond): Adjust caller.
	(forward_propagate_into_cond): Likewise.
	(forward_propagate_comparison): Likewise.
	(tree_ssa_forward_propagate_single_use_vars): Make
	forward_propagate_comparison case similar to the two others.

	* g++.dg/opt/pr47632.C: New testcase.

Added:
    trunk/gcc/testsuite/g++.dg/opt/pr47632.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-forwprop.c
Comment 4 Richard Biener 2011-02-08 10:47:34 UTC
Fixed.
Comment 5 Jeffrey A. Law 2011-02-08 14:45:16 UTC
*** Bug 47640 has been marked as a duplicate of this bug. ***