re PR lto/54980 (gimple check: expected gimple_cond(error_mark), have gimple_call...
authorJan Hubicka <jh@suse.cz>
Thu, 25 Oct 2012 14:52:32 +0000 (16:52 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Thu, 25 Oct 2012 14:52:32 +0000 (14:52 +0000)
PR tree-optimize/54980
* tree-ssa-loop-ivcanon.c (constant_after_peeling): Fix
obvious typo.
(loop_edge_to_cancel): Be sure that the edge is from an conditional
so we can cancel it.

From-SVN: r192809

gcc/ChangeLog
gcc/tree-ssa-loop-ivcanon.c

index 542856abe2f8e4e394ace9607f6c3cb9032dc321..0dde7f8fb421734364625c6d517bc5f0287205af 100644 (file)
@@ -1,3 +1,11 @@
+2012-10-25  Jan Hubicka  <jh@suse.cz>
+
+       PR tree-optimize/54980
+       * tree-ssa-loop-ivcanon.c (constant_after_peeling): Fix
+       obvious typo.
+       (loop_edge_to_cancel): Be sure that the edge is from an conditional
+       so we can cancel it.
+
 2012-10-25  Marc Glisse  <marc.glisse@inria.fr>
 
        PR c++/54427
index 323045f32eb9f0e3a24331f170a3feac3380e34e..3868b45a4c39e24e0879230093d837a7e7b41318 100644 (file)
@@ -160,7 +160,7 @@ constant_after_peeling (tree op, gimple stmt, struct loop *loop)
       /* First make fast look if we see constant array inside.  */
       while (handled_component_p (base))
        base = TREE_OPERAND (base, 0);
-      if ((DECL_P (base) == VAR_DECL
+      if ((DECL_P (base)
           && const_value_known_p (base))
          || CONSTANT_CLASS_P (base))
        {
@@ -364,6 +364,10 @@ loop_edge_to_cancel (struct loop *loop)
        else
          edge_to_cancel = EDGE_SUCC (edge_to_cancel->src, 0);
 
+      /* We only can handle conditionals.  */
+      if (!(edge_to_cancel->flags & (EDGE_TRUE_VALUE | EDGE_FALSE_VALUE)))
+       continue;
+
       /* We should never have conditionals in the loop latch. */
       gcc_assert (edge_to_cancel->dest != loop->header);