re PR debug/71642 (ICE: in gen_type_die_with_usage, at dwarf2out.c:22729)
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 24 Jun 2016 19:28:18 +0000 (19:28 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Fri, 24 Jun 2016 19:28:18 +0000 (19:28 +0000)
PR debug/71642
* tree-inline.c (remap_decl): When fixing up DECL_ORIGINAL_TYPE, just
copy the type name.

From-SVN: r237771

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr71642.f90 [new file with mode: 0644]
gcc/tree-inline.c

index 71b818167edac458a4db4292ebd76a8c7d56e91f..2bcf6b4fcdb743cb772947efb13888edc95c531c 100644 (file)
@@ -1,3 +1,9 @@
+2016-06-24  Eric Botcazou  <ebotcazou@adacore.com>
+
+       PR debug/71642
+       * tree-inline.c (remap_decl): When fixing up DECL_ORIGINAL_TYPE, just
+       copy the type name.
+
 2016-06-24  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/71647
index 1ec279cf0eb360e0a0eb8009b5710feedef6b380..bbb2214a7a07232538948ada7826230f580f290c 100644 (file)
@@ -1,3 +1,7 @@
+2016-06-24  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gfortran.dg/pr71642.f90: New test.
+
 2016-06-24  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/71647
diff --git a/gcc/testsuite/gfortran.dg/pr71642.f90 b/gcc/testsuite/gfortran.dg/pr71642.f90
new file mode 100644 (file)
index 0000000..53491d9
--- /dev/null
@@ -0,0 +1,27 @@
+! PR debug/71642
+! { dg-do compile }
+! { dg-options "-g" }
+
+MODULE gauss_colloc
+  INTEGER, PARAMETER :: dp=8
+CONTAINS
+SUBROUTINE collocGauss(h,h_inv,grid,poly,alphai,posi,max_r2,&
+        periodic,gdim,local_bounds,local_shift,poly_shift,scale,lgrid,error)
+    REAL(dp), DIMENSION(0:, 0:, 0:), &
+      INTENT(inout)                          :: grid
+    INTEGER, INTENT(inout), OPTIONAL :: lgrid
+    CONTAINS
+    SUBROUTINE kloop6
+    IF (kJump/=1 .AND. (ikstart+kmax-kstart>=ndim(2)+l_shift(2) .OR.&
+        ikstart2+kmin-kstart2<=l_ub(2)-ndim(2))) THEN
+        DO
+            DO k=kstart2,kend2,-1
+                IF ( PRESENT ( lgrid ) ) THEN
+                  grid(ik,ij,ii) = grid(ik,ij,ii) + p_v*res_k
+                END IF
+            END DO
+        END DO
+    END IF
+    END SUBROUTINE
+END SUBROUTINE
+END MODULE gauss_colloc
index a0d9e934e6d94271a0fd9f5cfb06935a9c48aa30..ef588662ace49874fa3da4e2578aa3fda795372a 100644 (file)
@@ -377,7 +377,7 @@ remap_decl (tree decl, copy_body_data *id)
            {
              tree x = build_variant_type_copy (TREE_TYPE (t));
              TYPE_STUB_DECL (x) = TYPE_STUB_DECL (TREE_TYPE (t));
-             TYPE_NAME (x) = t;
+             TYPE_NAME (x) = TYPE_NAME (TREE_TYPE (t));
              DECL_ORIGINAL_TYPE (t) = x;
            }
        }