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 44914 - add TODO_cleanup_cfg to IPA-SRA


Hi,

this simple patch fixes PR 44914.  IPA-SRA might have left some
unreachable BBs in the CFG.

Bootstrapped and regression tested without any problems on both trunk
and the 4.5 branch.  I would like to commit it to both but I
understand the 4.5 branch is frozen.  OTOH, this patch is simple and
it would be nice to have it in 4.5.1.  Richi, please let me know what
I should do.

Thanks,

Martin



2010-07-22  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/44914
	* tree-sra.c (ipa_early_sra): Return also TODO_cleanup_cfg if function
	was changed.

	* testsuite/g++.dg/tree-ssa/pr44914.C: New test.

Index: mine/gcc/tree-sra.c
===================================================================
--- mine.orig/gcc/tree-sra.c
+++ mine/gcc/tree-sra.c
@@ -4410,7 +4410,7 @@ ipa_early_sra (void)
 
   modify_function (node, adjustments);
   VEC_free (ipa_parm_adjustment_t, heap, adjustments);
-  ret = TODO_update_ssa;
+  ret = TODO_update_ssa | TODO_cleanup_cfg;
 
   statistics_counter_event (cfun, "Unused parameters deleted",
 			    sra_stats.deleted_unused_parameters);
Index: mine/gcc/testsuite/g++.dg/tree-ssa/pr44914.C
===================================================================
--- /dev/null
+++ mine/gcc/testsuite/g++.dg/tree-ssa/pr44914.C
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fipa-sra -fnon-call-exceptions" } */
+
+struct A
+{
+  ~A () { }
+};
+
+struct B
+{
+  A a;
+  int i;
+  void f (int) { }
+  B ()
+  {
+    f (i);
+  }
+};
+
+B b;


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