aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-dfa.c
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2020-06-17 07:50:57 -0400
committerAldy Hernandez <aldyh@redhat.com>2020-06-17 07:50:57 -0400
commitb9e67f2840ce0d8859d96e7f8df8fe9584af5eba (patch)
treeed3b7284ff15c802583f6409b9c71b3739642d15 /gcc/tree-dfa.c
parent1957047ed1c94bf17cf993a2b1866965f493ba87 (diff)
parent56638b9b1853666f575928f8baf17f70e4ed3517 (diff)
downloadgcc-b9e67f2840ce0d8859d96e7f8df8fe9584af5eba.zip
gcc-b9e67f2840ce0d8859d96e7f8df8fe9584af5eba.tar.gz
gcc-b9e67f2840ce0d8859d96e7f8df8fe9584af5eba.tar.bz2
Merge from trunk at:
commit 56638b9b1853666f575928f8baf17f70e4ed3517 Author: GCC Administrator <gccadmin@gcc.gnu.org> Date: Wed Jun 17 00:16:36 2020 +0000 Daily bump.
Diffstat (limited to 'gcc/tree-dfa.c')
-rw-r--r--gcc/tree-dfa.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c
index b6edc5c..3283d11 100644
--- a/gcc/tree-dfa.c
+++ b/gcc/tree-dfa.c
@@ -806,23 +806,25 @@ get_addr_base_and_unit_offset_1 (tree exp, poly_int64_pod *poffset,
if (valueize
&& TREE_CODE (index) == SSA_NAME)
index = (*valueize) (index);
+ if (!poly_int_tree_p (index))
+ return NULL_TREE;
+ low_bound = array_ref_low_bound (exp);
+ if (valueize
+ && TREE_CODE (low_bound) == SSA_NAME)
+ low_bound = (*valueize) (low_bound);
+ if (!poly_int_tree_p (low_bound))
+ return NULL_TREE;
+ unit_size = array_ref_element_size (exp);
+ if (TREE_CODE (unit_size) != INTEGER_CST)
+ return NULL_TREE;
/* If the resulting bit-offset is constant, track it. */
- if (poly_int_tree_p (index)
- && (low_bound = array_ref_low_bound (exp),
- poly_int_tree_p (low_bound))
- && (unit_size = array_ref_element_size (exp),
- TREE_CODE (unit_size) == INTEGER_CST))
- {
- poly_offset_int woffset
- = wi::sext (wi::to_poly_offset (index)
- - wi::to_poly_offset (low_bound),
- TYPE_PRECISION (TREE_TYPE (index)));
- woffset *= wi::to_offset (unit_size);
- byte_offset += woffset.force_shwi ();
- }
- else
- return NULL_TREE;
+ poly_offset_int woffset
+ = wi::sext (wi::to_poly_offset (index)
+ - wi::to_poly_offset (low_bound),
+ TYPE_PRECISION (TREE_TYPE (index)));
+ woffset *= wi::to_offset (unit_size);
+ byte_offset += woffset.force_shwi ();
}
break;