From patchwork Thu Jul 22 18:06:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Fix 44914 - add TODO_cleanup_cfg to IPA-SRA Date: Thu, 22 Jul 2010 08:06:36 -0000 From: Martin Jambor X-Patchwork-Id: 59621 Message-Id: <20100722180636.GE8513@virgil.arch.suse.de> To: GCC Patches Cc: Richard Guenther 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 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;