aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-structalias.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2014-03-11 15:32:27 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2014-03-11 15:32:27 +0000
commitdfd7d2d68b96580180f6d482ffd381913de83ee4 (patch)
treef4ac1c996b050838e54964bc39ecaac2862b700a /gcc/tree-ssa-structalias.c
parentaf1ab44914e9d544f7b24c21634e02f62ef086ff (diff)
downloadgcc-dfd7d2d68b96580180f6d482ffd381913de83ee4.zip
gcc-dfd7d2d68b96580180f6d482ffd381913de83ee4.tar.gz
gcc-dfd7d2d68b96580180f6d482ffd381913de83ee4.tar.bz2
tree-ssa-structalias.c (get_constraint_for_ptr_offset): Add asserts to guard possible wrong-code bugs.
2014-03-11 Richard Biener <rguenther@suse.de> * tree-ssa-structalias.c (get_constraint_for_ptr_offset): Add asserts to guard possible wrong-code bugs. From-SVN: r208485
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r--gcc/tree-ssa-structalias.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index e1e1147..8201cb4 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -3095,7 +3095,7 @@ get_constraint_for_ptr_offset (tree ptr, tree offset,
if (c.type == ADDRESSOF
/* If this varinfo represents a full variable just use it. */
&& curr->is_full_var)
- c.offset = 0;
+ ;
else if (c.type == ADDRESSOF
/* If we do not know the offset add all subfields. */
&& rhsoffset == UNKNOWN_OFFSET)
@@ -3143,8 +3143,14 @@ get_constraint_for_ptr_offset (tree ptr, tree offset,
temp = vi_next (temp);
}
}
+ else if (c.type == SCALAR)
+ {
+ gcc_assert (c.offset == 0);
+ c.offset = rhsoffset;
+ }
else
- c.offset = rhsoffset;
+ /* We shouldn't get any DEREFs here. */
+ gcc_unreachable ();
(*results)[j] = c;
}