OSDN Git Service

* trans-decl.c (gfc_build_qualified_array): Clear DECL_IGNORED_P
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 15 Apr 2010 08:53:41 +0000 (08:53 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:32:37 +0000 (14:32 +0900)
on VAR_DECL LBOUND and/or UBOUND, even for -O1.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158366 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/trans-decl.c

index b1b34ee..fdf4e99 100644 (file)
@@ -1,6 +1,11 @@
+2010-04-15  Jakub Jelinek  <jakub@redhat.com>
+
+       * trans-decl.c (gfc_build_qualified_array): Clear DECL_IGNORED_P
+       on VAR_DECL LBOUND and/or UBOUND, even for -O1.
+
 2010-04-14  Steven G. Kargl  <kargl@gcc.gnu.org>
 
-       * fortran/intrinsic.texi: Add the missing specific name of intrinsic
+       * intrinsic.texi: Add the missing specific name of intrinsic
        procedure where the specific name is identical to the generic name.
        Fix inconsistent or mismatch in the argument names in intrinsic
        procedure descriptions.  Add the SCALAR allocatable description to
index e24390b..7393f49 100644 (file)
@@ -778,27 +778,13 @@ gfc_build_qualified_array (tree decl, gfc_symbol * sym)
          gtype = build_array_type (gtype, rtype);
          /* Ensure the bound variables aren't optimized out at -O0.
             For -O1 and above they often will be optimized out, but
-            can be tracked by VTA.  Also clear the artificial
-            lbound.N or ubound.N DECL_NAME, so that it doesn't end up
-            in debug info.  */
-         if (lbound && TREE_CODE (lbound) == VAR_DECL
-             && DECL_ARTIFICIAL (lbound) && DECL_IGNORED_P (lbound))
-           {
-             if (DECL_NAME (lbound)
-                 && strstr (IDENTIFIER_POINTER (DECL_NAME (lbound)),
-                            "lbound") != 0)
-               DECL_NAME (lbound) = NULL_TREE;
-             DECL_IGNORED_P (lbound) = 0;
-           }
-         if (ubound && TREE_CODE (ubound) == VAR_DECL
-             && DECL_ARTIFICIAL (ubound) && DECL_IGNORED_P (ubound))
-           {
-             if (DECL_NAME (ubound)
-                 && strstr (IDENTIFIER_POINTER (DECL_NAME (ubound)),
-                            "ubound") != 0)
-               DECL_NAME (ubound) = NULL_TREE;
-             DECL_IGNORED_P (ubound) = 0;
-           }
+            can be tracked by VTA.  */
+         if (GFC_TYPE_ARRAY_LBOUND (type, dim)
+             && TREE_CODE (GFC_TYPE_ARRAY_LBOUND (type, dim)) == VAR_DECL)
+           DECL_IGNORED_P (GFC_TYPE_ARRAY_LBOUND (type, dim)) = 0;
+         if (GFC_TYPE_ARRAY_UBOUND (type, dim)
+             && TREE_CODE (GFC_TYPE_ARRAY_UBOUND (type, dim)) == VAR_DECL)
+           DECL_IGNORED_P (GFC_TYPE_ARRAY_UBOUND (type, dim)) = 0;
        }
       TYPE_NAME (type) = type_decl = build_decl (input_location,
                                                 TYPE_DECL, NULL, gtype);