aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-dse.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2018-08-27 22:02:11 -0600
committerJeff Law <law@gcc.gnu.org>2018-08-27 22:02:11 -0600
commita1ae0cbd96f326debd929214ee78cf683fc6f2a6 (patch)
treef6c36d9521210e0db5f9a093aa271694d23bad4b /gcc/tree-ssa-dse.c
parentd1af2f668fb0fca982183265e1a56e23d4f25fa8 (diff)
downloadgcc-a1ae0cbd96f326debd929214ee78cf683fc6f2a6.zip
gcc-a1ae0cbd96f326debd929214ee78cf683fc6f2a6.tar.gz
gcc-a1ae0cbd96f326debd929214ee78cf683fc6f2a6.tar.bz2
re PR tree-optimization/87110 ([9 Regresssion] tree check fail in to_wide, at tree.h:5523)
PR tree-optimization/87110 * tree-ssa-dse.c (compute_trims): Handle non-constant TYPE_SIZE_UNIT. PR tree-optimization/87110 * gcc.c-torture/compile/pr87110.c: New test. From-SVN: r263906
Diffstat (limited to 'gcc/tree-ssa-dse.c')
-rw-r--r--gcc/tree-ssa-dse.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c
index bddbbe8..8b7aea0 100644
--- a/gcc/tree-ssa-dse.c
+++ b/gcc/tree-ssa-dse.c
@@ -250,9 +250,13 @@ compute_trims (ao_ref *ref, sbitmap live, int *trim_head, int *trim_tail,
*trim_tail = last_orig - last_live;
/* But don't trim away out of bounds accesses, as this defeats
- proper warnings. */
+ proper warnings.
+
+ We could have a type with no TYPE_SIZE_UNIT or we could have a VLA
+ where TYPE_SIZE_UNIT is not a constant. */
if (*trim_tail
&& TYPE_SIZE_UNIT (TREE_TYPE (ref->base))
+ && TREE_CODE (TYPE_SIZE_UNIT (TREE_TYPE (ref->base))) == INTEGER_CST
&& compare_tree_int (TYPE_SIZE_UNIT (TREE_TYPE (ref->base)),
last_orig) <= 0)
*trim_tail = 0;