This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR56426
- From: Tom de Vries <Tom_deVries at mentor dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Richard Biener <rguenther at suse dot de>
- Date: Thu, 31 Jul 2014 10:31:05 +0200
- Subject: Re: [PATCH] Fix PR56426
- Authentication-results: sourceware.org; auth=none
- References: <20130225195311 dot GB25197 at redhat dot com>
On 25-02-13 20:53, Marek Polacek wrote:
2013-02-25 Marek Polacek <polacek@redhat.com>
PR tree-optimization/56426
* tree-ssa-loop.c (tree_ssa_loop_init): Always call
scev_initialize.
* gcc.dg/pr56436.c: New test.
--- gcc/tree-ssa-loop.c.mp 2013-02-25 13:06:47.212132327 +0100
+++ gcc/tree-ssa-loop.c 2013-02-25 20:09:30.668978936 +0100
@@ -70,10 +70,13 @@ tree_ssa_loop_init (void)
| LOOPS_HAVE_RECORDED_EXITS);
rewrite_into_loop_closed_ssa (NULL, TODO_update_ssa);
+ /* We might discover new loops, e.g. when turning irreducible
+ regions into reducible. */
+ scev_initialize ();
+
if (number_of_loops () <= 1)
return 0;
- scev_initialize ();
return 0;
}
Marek,
moving scev_initialize up leaves the if-clause as dead code. This patches
removes that dead code. Bootstrapped and reg-tested with tree-ssa.exp.
Committed as trivial.
Thanks,
- Tom
2014-07-30 Tom de Vries <tom@codesourcery.com>
* tree-ssa-loop.c (pass_tree_loop_init::execute): Remove dead code.
diff --git a/gcc/tree-ssa-loop.c b/gcc/tree-ssa-loop.c
index 7c52748..d0c9980 100644
--- a/gcc/tree-ssa-loop.c
+++ b/gcc/tree-ssa-loop.c
@@ -168,7 +168,7 @@ public:
}; // class pass_tree_loop_init
unsigned int
-pass_tree_loop_init::execute (function *fun)
+pass_tree_loop_init::execute (function *fun ATTRIBUTE_UNUSED)
{
loop_optimizer_init (LOOPS_NORMAL
| LOOPS_HAVE_RECORDED_EXITS);
@@ -178,9 +178,6 @@ pass_tree_loop_init::execute (function *fun)
regions into reducible. */
scev_initialize ();
- if (number_of_loops (fun) <= 1)
- return 0;
-
return 0;
}