re PR middle-end/90982 (ICE in make_decl_rtl, at varasm.c:1344)
authorRichard Biener <rguenther@suse.de>
Wed, 26 Jun 2019 11:16:56 +0000 (11:16 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 26 Jun 2019 11:16:56 +0000 (11:16 +0000)
2019-06-26  Richard Biener  <rguenther@suse.de>

PR ipa/90982
* tree-inline.c (remap_ssa_name): Copy SSA range info.

* g++.dg/torture/pr90982.C: New testcase.

From-SVN: r272688

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/torture/pr90982.C [new file with mode: 0644]
gcc/tree-inline.c

index 3f4576fcefbebbf56a0b8620633fdc91c63ff0ba..432020fb99a50c5fdc98e815ab808bae7400e6ff 100644 (file)
@@ -1,3 +1,8 @@
+2019-06-26  Richard Biener  <rguenther@suse.de>
+
+       PR ipa/90982
+       * tree-inline.c (remap_ssa_name): Copy SSA range info.
+
 2019-06-26  Richard Biener  <rguenther@suse.de>
 
        * lto-streamer.h (lto_bitmap_alloc): Remove.
index 4fbc331d8d9dcd96f36740748f7aa10971418a8c..b16e23a73736cbc1acd03d6aa2cbcbcf4c69a7c1 100644 (file)
@@ -1,3 +1,8 @@
+2019-06-26  Richard Biener  <rguenther@suse.de>
+
+       PR ipa/90982
+       * g++.dg/torture/pr90982.C: New testcase.
+
 2019-06-26  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/67184
diff --git a/gcc/testsuite/g++.dg/torture/pr90982.C b/gcc/testsuite/g++.dg/torture/pr90982.C
new file mode 100644 (file)
index 0000000..8edbb7c
--- /dev/null
@@ -0,0 +1,23 @@
+// { dg-do compile }
+
+template <int n> struct S
+{
+  long c[n];
+  void f (S d)
+    {
+      for (int i = 2;; i++)
+       c[i] &= d.c[i];
+    }
+};
+
+template <int m> struct T:S<m/64>
+{
+  void operator &= (T d)
+    { this -> f (d); }
+};
+
+void g (T<192> &d)
+{
+  T<192> v;
+  d &= v;
+}
index 2de5e22f10fd60bee904de1f77578424b82fb7bf..48619fbc821f12199aaf4468472c93d8485c85f5 100644 (file)
@@ -259,6 +259,11 @@ remap_ssa_name (tree name, copy_body_data *id)
          struct ptr_info_def *new_pi = get_ptr_info (new_tree);
          new_pi->pt = pi->pt;
        }
+      /* So can range-info.  */
+      if (!POINTER_TYPE_P (TREE_TYPE (name))
+         && SSA_NAME_RANGE_INFO (name))
+       duplicate_ssa_name_range_info (new_tree, SSA_NAME_RANGE_TYPE (name),
+                                      SSA_NAME_RANGE_INFO (name));
       return new_tree;
     }
 
@@ -292,6 +297,11 @@ remap_ssa_name (tree name, copy_body_data *id)
          struct ptr_info_def *new_pi = get_ptr_info (new_tree);
          new_pi->pt = pi->pt;
        }
+      /* So can range-info.  */
+      if (!POINTER_TYPE_P (TREE_TYPE (name))
+         && SSA_NAME_RANGE_INFO (name))
+       duplicate_ssa_name_range_info (new_tree, SSA_NAME_RANGE_TYPE (name),
+                                      SSA_NAME_RANGE_INFO (name));
       if (SSA_NAME_IS_DEFAULT_DEF (name))
        {
          /* By inlining function having uninitialized variable, we might