From 84822e3d5e732abfec6c25b8ed3088ea32c4d3db Mon Sep 17 00:00:00 2001 From: rguenth Date: Tue, 11 Mar 2014 15:32:27 +0000 Subject: [PATCH] 2014-03-11 Richard Biener * tree-ssa-structalias.c (get_constraint_for_ptr_offset): Add asserts to guard possible wrong-code bugs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208485 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/tree-ssa-structalias.c | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a382415..92df471 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2014-03-11 Richard Biener + * tree-ssa-structalias.c (get_constraint_for_ptr_offset): + Add asserts to guard possible wrong-code bugs. + +2014-03-11 Richard Biener + PR tree-optimization/60429 PR tree-optimization/60485 * tree-ssa-structalias.c (set_union_with_increment): Properly 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; } -- 2.7.4