diff mbox

Fix PR56426

Message ID 53D9FEC9.9080905@mentor.com
State New
Headers show

Commit Message

Tom de Vries July 31, 2014, 8:31 a.m. UTC
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
diff mbox

Patch

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;
 }