aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-structalias.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2016-07-19 10:18:25 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2016-07-19 10:18:25 +0000
commit9a4cb9733db86b7be143a2b8ab7d03406e025a5d (patch)
tree01fb62930fcc3a0f17e46e862d62ba9c4a743d73 /gcc/tree-ssa-structalias.c
parentd9157f1514cb8f9e64e4b57c5461a9bb9b03427f (diff)
downloadgcc-9a4cb9733db86b7be143a2b8ab7d03406e025a5d.zip
gcc-9a4cb9733db86b7be143a2b8ab7d03406e025a5d.tar.gz
gcc-9a4cb9733db86b7be143a2b8ab7d03406e025a5d.tar.bz2
re PR tree-optimization/71908 (ICE at -Os and above in both 32-bit and 64-bit modes on x86_64-linux-gnu (get_constraint_for_component_ref))
2016-07-18 Richard Biener <rguenther@suse.de> PR tree-optimization/71908 * tree-ssa-structalias.c (get_constraint_for_component_ref): Handle symbolic constants in a more reliable way. * gcc.dg/torture/pr71908.c: New testcase. From-SVN: r238467
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r--gcc/tree-ssa-structalias.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 5e3c7d0..a96fcab 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -3211,6 +3211,20 @@ get_constraint_for_component_ref (tree t, vec<ce_s> *results,
t = get_ref_base_and_extent (t, &bitpos, &bitsize, &bitmaxsize, &reverse);
+ /* We can end up here for component references on a
+ VIEW_CONVERT_EXPR <>(&foobar) or things like a
+ BIT_FIELD_REF <&MEM[(void *)&b + 4B], ...>. So for
+ symbolic constants simply give up. */
+ if (TREE_CODE (t) == ADDR_EXPR)
+ {
+ constraint_expr result;
+ result.type = SCALAR;
+ result.var = anything_id;
+ result.offset = 0;
+ results->safe_push (result);
+ return;
+ }
+
/* Pretend to take the address of the base, we'll take care of
adding the required subset of sub-fields below. */
get_constraint_for_1 (t, results, true, lhs_p);
@@ -3300,8 +3314,8 @@ get_constraint_for_component_ref (tree t, vec<ce_s> *results,
}
else if (result.type == ADDRESSOF)
{
- /* We can end up here for component references on a
- VIEW_CONVERT_EXPR <>(&foobar). */
+ /* We can end up here for component references on constants like
+ VIEW_CONVERT_EXPR <>({ 0, 1, 2, 3 })[i]. */
result.type = SCALAR;
result.var = anything_id;
result.offset = 0;