This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix PR45316


This fixes PR45316.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2010-08-25  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/45316
	* tree-ssa-pre.c (eliminate): Properly clean EH info.

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

Index: gcc/tree-ssa-pre.c
===================================================================
*** gcc/tree-ssa-pre.c	(revision 163541)
--- gcc/tree-ssa-pre.c	(working copy)
*************** eliminate (void)
*** 4498,4506 ****
--- 4498,4509 ----
        if (TREE_CODE (lhs) != SSA_NAME
  	  || has_zero_uses (lhs))
  	{
+ 	  basic_block bb = gimple_bb (stmt);
  	  gsi = gsi_for_stmt (stmt);
  	  unlink_stmt_vdef (stmt);
  	  gsi_remove (&gsi, true);
+ 	  if (gimple_purge_dead_eh_edges (bb))
+ 	    todo |= TODO_cleanup_cfg;
  	  if (TREE_CODE (lhs) == SSA_NAME)
  	    bitmap_clear_bit (inserted_exprs, SSA_NAME_VERSION (lhs));
  	  release_defs (stmt);
Index: gcc/testsuite/g++.dg/opt/pr45316.C
===================================================================
*** gcc/testsuite/g++.dg/opt/pr45316.C	(revision 0)
--- gcc/testsuite/g++.dg/opt/pr45316.C	(revision 0)
***************
*** 0 ****
--- 1,28 ----
+ // { dg-do compile }
+ // { dg-options "-O1 -ftree-pre -fnon-call-exceptions" }
+ 
+ struct A
+ {
+   int i;
+ };
+ 
+ struct B : A
+ {
+   int i[6];
+   B (int = 0) : A ()
+   {
+     m ();
+   }
+   int m ();
+ };
+ 
+ struct C : B
+ {
+ };
+ 
+ void
+ foo ()
+ {
+   new C ();
+ }
+ 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]