From 532bb2f908e6a14eda50ebd4debda9d063e4f8e7 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Thu, 4 Jul 2019 18:30:53 +0200 Subject: [PATCH] tree-ssa-alias.c (nonoverlapping_component_refs_since_match_p): Fix check for match in the ref walk. * tree-ssa-alias.c (nonoverlapping_component_refs_since_match_p): Fix check for match in the ref walk. From-SVN: r273090 --- gcc/ChangeLog | 5 +++++ gcc/tree-ssa-alias.c | 8 ++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d4e999194f0..351701193f6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-07-04 Jan Hubicka + + * tree-ssa-alias.c (nonoverlapping_component_refs_since_match_p): + Fix check for match in the ref walk. + 2019-07-04 Martin Liska * tree-ssa-loop-niter.c (get_upper_bound_based_on_builtin_expr_with_prob): diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index d76656e57af..5c5cbe41fec 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -1153,15 +1153,13 @@ nonoverlapping_component_refs_since_match_p (tree match1, tree ref1, auto_vec component_refs2; /* Create the stack of handled components for REF1. */ - while (handled_component_p (ref1)) + while (handled_component_p (ref1) && ref1 != match1) { if (TREE_CODE (ref1) == VIEW_CONVERT_EXPR || TREE_CODE (ref1) == BIT_FIELD_REF) component_refs1.truncate (0); else component_refs1.safe_push (ref1); - if (ref1 == match1) - break; ref1 = TREE_OPERAND (ref1, 0); } if (TREE_CODE (ref1) == MEM_REF && ref1 != match1) @@ -1180,15 +1178,13 @@ nonoverlapping_component_refs_since_match_p (tree match1, tree ref1, } /* Create the stack of handled components for REF2. */ - while (handled_component_p (ref2)) + while (handled_component_p (ref2) && ref2 != match2) { if (TREE_CODE (ref2) == VIEW_CONVERT_EXPR || TREE_CODE (ref2) == BIT_FIELD_REF) component_refs2.truncate (0); else component_refs2.safe_push (ref2); - if (ref2 == match2) - break; ref2 = TREE_OPERAND (ref2, 0); } if (TREE_CODE (ref2) == MEM_REF && ref2 != match2) -- 2.30.2