aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-prop.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-06-19 07:17:55 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-06-19 07:17:55 +0000
commitdb9bbdeca441e21f50b12cbfc2ff34992242b4f3 (patch)
tree2dd74aa5ee4c48fb661ebf5776878a3a0c3167a9 /gcc/ipa-prop.c
parent245ad722ca8f9605165f90f9dd3f8e6137e68b38 (diff)
downloadgcc-db9bbdeca441e21f50b12cbfc2ff34992242b4f3.zip
gcc-db9bbdeca441e21f50b12cbfc2ff34992242b4f3.tar.gz
gcc-db9bbdeca441e21f50b12cbfc2ff34992242b4f3.tar.bz2
re PR ipa/81112 (internal compiler error: tree check: expected integer_cst, have range_expr in get_len, at tree.h:5321)
2017-06-19 Richard Biener <rguenther@suse.de> PR ipa/81112 * ipa-prop.c (find_constructor_constant_at_offset): Handle RANGE_EXPR conservatively. * g++.dg/torture/pr81112.C: New testcase. From-SVN: r249357
Diffstat (limited to 'gcc/ipa-prop.c')
-rw-r--r--gcc/ipa-prop.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 292f3e2..51f6221 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -3013,7 +3013,10 @@ find_constructor_constant_at_offset (tree constructor, HOST_WIDE_INT req_offset)
if (index)
{
- off = wi::to_offset (index);
+ if (TREE_CODE (index) == RANGE_EXPR)
+ off = wi::to_offset (TREE_OPERAND (index, 0));
+ else
+ off = wi::to_offset (index);
if (TYPE_DOMAIN (type) && TYPE_MIN_VALUE (TYPE_DOMAIN (type)))
{
tree low_bound = TYPE_MIN_VALUE (TYPE_DOMAIN (type));
@@ -3022,6 +3025,8 @@ find_constructor_constant_at_offset (tree constructor, HOST_WIDE_INT req_offset)
TYPE_PRECISION (TREE_TYPE (index)));
}
off *= wi::to_offset (unit_size);
+ /* ??? Handle more than just the first index of a
+ RANGE_EXPR. */
}
else
off = wi::to_offset (unit_size) * ix;