]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/44562 (ICE: in get_alias_set, at alias.c:716 with -flto ...
authorRichard Guenther <rguenther@suse.de>
Wed, 25 Aug 2010 14:05:28 +0000 (14:05 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 25 Aug 2010 14:05:28 +0000 (14:05 +0000)
2010-08-25  Richard Guenther  <rguenther@suse.de>

PR lto/44562
* lto-streamer.c (lto_record_common_node): Do not mess with
TYPE_CANONICAL when not in lto.
* gimple.c (gimple_register_type): Likewise.

* gcc.dg/graphite/id-27.c: New testcase.
* gcc.dg/lto/20100825-1_0.c: Likewise.

From-SVN: r163545

gcc/ChangeLog
gcc/gimple.c
gcc/lto-streamer.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/graphite/id-27.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/lto/20100825-1_0.c [new file with mode: 0644]

index b3ff5165212d73894a29b3ee384b56ab68538ec5..a0bef4e60a896c1db1663863ec87b8f39254ab2c 100644 (file)
@@ -1,3 +1,10 @@
+2010-08-25  Richard Guenther  <rguenther@suse.de>
+
+       PR lto/44562
+       * lto-streamer.c (lto_record_common_node): Do not mess with
+       TYPE_CANONICAL when not in lto.
+       * gimple.c (gimple_register_type): Likewise.
+
 2010-08-25  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/45316
index 9d5c61bcecffee1f0151eed402ab55321a133237..50b2eab4c527a78555ae439d665cc0ef7a85ec9b 100644 (file)
@@ -4215,8 +4215,9 @@ gimple_register_type (tree t)
   gcc_assert (TYPE_P (t));
 
   /* In TYPE_CANONICAL we cache the result of gimple_register_type.
-     It is initially set to NULL during LTO streaming.  */
-  if (TYPE_CANONICAL (t))
+     It is initially set to NULL during LTO streaming.
+     But do not mess with TYPE_CANONICAL when not in WPA or link phase.  */
+  if (in_lto_p && TYPE_CANONICAL (t))
     return TYPE_CANONICAL (t);
 
   /* Always register the main variant first.  This is important so we
@@ -4282,12 +4283,14 @@ gimple_register_type (tree t)
          TYPE_NEXT_REF_TO (t) = NULL_TREE;
        }
 
-      TYPE_CANONICAL (t) = new_type;
+      if (in_lto_p)
+       TYPE_CANONICAL (t) = new_type;
       t = new_type;
     }
   else
     {
-      TYPE_CANONICAL (t) = t;
+      if (in_lto_p)
+       TYPE_CANONICAL (t) = t;
       *slot = (void *) t;
     }
 
index 2b3d1724fe7487aa4db3b2ef08487056eb3861ce..27b7e56050826eaab39d307ae3e706c8d9cf568c 100644 (file)
@@ -524,7 +524,8 @@ lto_record_common_node (tree *nodep, VEC(tree, heap) **common_nodes,
     {
       /* Type merging will get confused by the canonical types as they
         are set by the middle-end.  */
-      TYPE_CANONICAL (node) = NULL_TREE;
+      if (in_lto_p)
+       TYPE_CANONICAL (node) = NULL_TREE;
       *nodep = node = gimple_register_type (node);
     }
 
index ba13e9e8fb90f2150a873c44bcad088ddb9b430e..6e8b1407c28347b528f5d31b1caac77fb6bfd393 100644 (file)
@@ -1,3 +1,9 @@
+2010-08-25  Richard Guenther  <rguenther@suse.de>
+
+       PR lto/44562
+       * gcc.dg/graphite/id-27.c: New testcase.
+       * gcc.dg/lto/20100825-1_0.c: Likewise.
+
 2010-08-25  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/45316
diff --git a/gcc/testsuite/gcc.dg/graphite/id-27.c b/gcc/testsuite/gcc.dg/graphite/id-27.c
new file mode 100644 (file)
index 0000000..d2d4cd3
--- /dev/null
@@ -0,0 +1,17 @@
+/* { dg-options "-O2 -fgraphite-identity -flto" { target lto } } */
+
+typedef long ll;
+void foo (int n, ll *p)
+{
+  while (n--)
+    *p += *p;
+}
+
+typedef long long lll;
+void bar (int n, lll *p)
+{
+  while (n--)
+    *p += *p;
+}
+
+int main() { return 0; }
diff --git a/gcc/testsuite/gcc.dg/lto/20100825-1_0.c b/gcc/testsuite/gcc.dg/lto/20100825-1_0.c
new file mode 100644 (file)
index 0000000..67b5ce0
--- /dev/null
@@ -0,0 +1,57 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options { { -O3 -flto } } } */
+
+typedef unsigned int UINT32;
+typedef unsigned long long UINT64;
+typedef struct { UINT64 w[2]; } UINT128;
+void _bid_to_dpd128 (UINT128 *, UINT128 *);
+static const int short_recip_scale[] = {
+  1,
+  65 - 64,
+  69 - 64,
+  71 - 64,
+  75 - 64,
+  78 - 64,
+  81 - 64,
+  85 - 64,
+  88 - 64,
+  91 - 64,
+  95 - 64,
+  98 - 64,
+  101 - 64,
+  105 - 64,
+  108 - 64,
+  111 - 64,
+  115 - 64,
+  118 - 64
+};
+
+void _bid_to_dpd128 (UINT128 *, UINT128 *);
+
+void
+_bid_to_dpd128 (UINT128 *pres, UINT128 *px) {
+  UINT128 res;
+  unsigned int comb;
+  UINT128 bcoeff;
+  UINT128 BH;
+  UINT64 BL, d109;
+  unsigned int amount;
+  UINT128 x = *px;
+
+  comb = (x.w[1] ) >> 46;
+  if ((comb & 0x1e000) == 0x1e000) {
+    res = x;
+  } else {
+    bcoeff.w[1] = (x.w[1] & 0x0001ffffffffffffull);
+    bcoeff.w[0] = x.w[0];
+    amount = 9;
+    BH.w[0] = (BH.w[0] >> amount) | (BH.w[1] << (64 - amount));
+    BL = bcoeff.w[0] - BH.w[0] * 1000000000000000000ull;
+    d109 = 0x3333333333333334ull;
+    { UINT64 CXH, CXL, CYH,CYL,PL,PH,PM,PM2; CXH = (BH.w[0]) >> 32; CXL = (UINT32)(BH.w[0]); CYH = (d109) >> 32; CYL = (UINT32)(d109); PM = CXH*CYL; PH = CXH*CYH; PL = CXL*CYL; PM2 = CXL*CYH; PH += (PM>>32); PM = (UINT64)((UINT32)PM)+PM2+(PL>>32); };
+    { UINT64 CXH, CXL, CYH,CYL,PL,PH,PM,PM2; CXH = (BL) >> 32; CXL = (UINT32)(BL); CYH = (d109) >> 32; CYL = (UINT32)(d109); PM = CXH*CYL; PH = CXH*CYH; PL = CXL*CYL; PM2 = CXL*CYH; PH += (PM>>32); PM = (UINT64)((UINT32)PM)+PM2+(PL>>32);  };
+  }
+  *pres = res;
+}
+
+int main() { return 0; }