]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-ssa-structalias.c (get_constraint_for_ptr_offset): Add asserts to guard possible...
authorRichard Biener <rguenther@suse.de>
Tue, 11 Mar 2014 15:32:27 +0000 (15:32 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 11 Mar 2014 15:32:27 +0000 (15:32 +0000)
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

gcc/ChangeLog
gcc/tree-ssa-structalias.c

index a38241587b63cdf5840dec8cfd7413e47be07883..92df4717c35ed69c07716b32b47b0da053575c51 100644 (file)
@@ -1,3 +1,8 @@
+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.
+
 2014-03-11  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/60429
index e1e1147e99355b111aa93e7a436efb6ec9a72906..8201cb423c1de652d43adbad3ba7725669f21ad1 100644 (file)
@@ -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;
     }