re PR middle-end/91190 (ICE on valid code: in hashtab_chk_error, at hash-table.c...
authorJakub Jelinek <jakub@redhat.com>
Fri, 19 Jul 2019 10:26:23 +0000 (12:26 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 19 Jul 2019 10:26:23 +0000 (12:26 +0200)
PR middle-end/91190
* function.c (insert_temp_slot_address): Store into the hash table
a copy of address to avoid RTL sharing issues.

* gcc.c-torture/compile/pr91190.c: New test.

From-SVN: r273599

gcc/ChangeLog
gcc/function.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr91190.c [new file with mode: 0644]

index 95868abb6d454bf1662a1d5c1159c2a4bffcecdf..3ac52e5f2b62457f13754970b0af797d1c6a80ae 100644 (file)
@@ -1,3 +1,9 @@
+2019-07-19  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/91190
+       * function.c (insert_temp_slot_address): Store into the hash table
+       a copy of address to avoid RTL sharing issues.
+
 2019-07-19  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/91207
index 373c1f2beb2d0f87a2e0e9bb2a59e2d9ae79a73b..2a0061cad358e2c58d208182764e3ba90eb16088 100644 (file)
@@ -704,7 +704,7 @@ static void
 insert_temp_slot_address (rtx address, class temp_slot *temp_slot)
 {
   struct temp_slot_address_entry *t = ggc_alloc<temp_slot_address_entry> ();
-  t->address = address;
+  t->address = copy_rtx (address);
   t->temp_slot = temp_slot;
   t->hash = temp_slot_address_compute_hash (t);
   *temp_slot_address_table->find_slot_with_hash (t, t->hash, INSERT) = t;
index b4fca286108b58b41d339669933fb5239acfbcf3..906ca0e5d305495ca69197f1281707ea21b52780 100644 (file)
@@ -1,3 +1,8 @@
+2019-07-19  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/91190
+       * gcc.c-torture/compile/pr91190.c: New test.
+
 2019-07-19  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/91207
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr91190.c b/gcc/testsuite/gcc.c-torture/compile/pr91190.c
new file mode 100644 (file)
index 0000000..10b792f
--- /dev/null
@@ -0,0 +1,31 @@
+/* PR middle-end/91190 */
+
+unsigned a[1], c;
+long d, h;
+int e[2], f, g;
+char i;
+
+int
+main ()
+{
+  char k = 0;
+  int l;
+  while (i || d)
+    {
+      if (g)
+       while (1)
+         ;
+      e[1] = 0;
+      long m[2], n = ~(3 & (5 | (h | 9) * 2237420170));
+      g = 90 * n;
+      char b = m[300000000], j = 0;
+      c = 5 ^ a[c ^ (b & 5)];
+      int o = d;
+      k = o ? : j;
+      if (k)
+       for (l = 0; l < 3; l++)
+         if (m[200000000000000000]) 
+           __builtin_printf ("%d", f);
+    }
+  return 0; 
+}