summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-ivcanon.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-25 14:52:32 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-25 14:52:32 +0000
commit248022b2c5ea602f9a64a926c213aad74f119152 (patch)
tree4ea7a5db9dd46f6e2bcb5902d32cc1518ce78171 /gcc/tree-ssa-loop-ivcanon.c
parent7b463b19dc03823c76901c991cd2d193a947c363 (diff)
downloadgcc-248022b2c5ea602f9a64a926c213aad74f119152.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192809 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-loop-ivcanon.c')
-rw-r--r--gcc/tree-ssa-loop-ivcanon.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c
index 323045f32eb..3868b45a4c3 100644
--- a/gcc/tree-ssa-loop-ivcanon.c
+++ b/gcc/tree-ssa-loop-ivcanon.c
@@ -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);