]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/22279 (ICE in first_vi_for_offset, at tree-ssa-structalias...
authorDaniel Berlin <dberlin@dberlin.org>
Mon, 4 Jul 2005 17:49:17 +0000 (17:49 +0000)
committerDaniel Berlin <dberlin@gcc.gnu.org>
Mon, 4 Jul 2005 17:49:17 +0000 (17:49 +0000)
2005-07-04  Daniel Berlin  <dberlin@dberlin.org>

Fix PR tree-optimization/22279

* tree-ssa-structalias.c (offset_overlaps_with_access): Use
correct operator.

From-SVN: r101603

gcc/ChangeLog
gcc/testsuite/g++.dg/tree-ssa/pr22279.C [new file with mode: 0644]
gcc/tree-ssa-structalias.c

index e8c93fd6b6b7c8b6462c9fe1e7bba85ba9cbbbe1..0bbe692aa8ee02edd517e8ed435f0d25a3770462 100644 (file)
@@ -1,3 +1,10 @@
+2005-07-04  Daniel Berlin  <dberlin@dberlin.org>
+
+       Fix PR tree-optimization/22279
+       
+       * tree-ssa-structalias.c (offset_overlaps_with_access): Use
+       correct operator.
+       
 2005-07-04  J"orn Rennecke <joern.rennecke@st.com>
 
        * sh.c (output_ieee_ccmpeq): Replace "\\;" with "\n\t".
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr22279.C b/gcc/testsuite/g++.dg/tree-ssa/pr22279.C
new file mode 100644 (file)
index 0000000..0e17f08
--- /dev/null
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+struct string
+{
+  long long _M_p;
+  long long i;
+  string();
+  int begin();
+  int end();
+  string(int, int);
+};
+struct symbol
+{
+  int type;
+  string name;
+  long long raw_name;
+  long long demangled_name;
+  long long version_name;
+  int version_status;
+  int status;
+  void init();
+};
+void symbol::init() { name = string(); }
+struct pair
+{
+  symbol first;
+  symbol second;
+  pair(const symbol& __a, const symbol& __b) : first(__a), second(__b) { }
+};
+struct vector
+{
+  void push_back(const pair& __x);
+};
+/* This ends up with two RHS deref copies, and we need to get the offsets right on them.  */
+void f(vector incompatible)
+{
+  symbol base;
+  incompatible.push_back(pair(base, base));
+}
+
+
+
index 06adb3ec60202bd7cedbae691868c33aa1267b37..6db77b77e30efc384bef958354a63c0412a5c211 100644 (file)
@@ -1951,7 +1951,7 @@ offset_overlaps_with_access (const unsigned HOST_WIDE_INT fieldpos,
 {
   if (fieldpos == accesspos && fieldsize == accesssize)
     return true;
-  if (accesspos >= fieldpos && accesspos <= (fieldpos + fieldsize))
+  if (accesspos >= fieldpos && accesspos < (fieldpos + fieldsize))
     return true;
   if (accesspos < fieldpos && (accesspos + accesssize > fieldpos))
     return true;