]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR debug/51517 (Wrong debug information for pointers with negative strides.)
authorJakub Jelinek <jakub@redhat.com>
Thu, 9 Feb 2012 17:13:50 +0000 (18:13 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 9 Feb 2012 17:13:50 +0000 (18:13 +0100)
Backported from mainline
2011-12-15  Jakub Jelinek  <jakub@redhat.com>

PR debug/51517
* tree-ssa-coalesce.c (coalesce_ssa_name): For !optimize, test
!DECL_IGNORED_P instead of !DECL_ARTIFICIAL.

* trans-decl.c (gfc_get_symbol_decl): Don't set DECL_INITAL on span.
(gfc_trans_deferred_vars): Instead add its runtime initialization
here.

From-SVN: r184048

gcc/ChangeLog
gcc/fortran/ChangeLog
gcc/fortran/trans-decl.c
gcc/tree-ssa-coalesce.c

index 7fe19d29d83253425362686bced7311ff2c2470b..fdd0daa557dc99d5fced959eeb14b7b37bbd6098 100644 (file)
@@ -1,3 +1,12 @@
+2012-02-09  Jakub Jelinek  <jakub@redhat.com>
+
+       Backported from mainline
+       2011-12-15  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/51517
+       * tree-ssa-coalesce.c (coalesce_ssa_name): For !optimize, test
+       !DECL_IGNORED_P instead of !DECL_ARTIFICIAL.
+
 2012-02-09  Peter Bergner  <bergner@vnet.ibm.com>
 
        Backport from mainline 
index 8c18aecbe218384f08794cbc6b15d35c6b97c77c..91be73403b3b72209db698fab1496da8a85c06fc 100644 (file)
@@ -1,3 +1,13 @@
+2012-02-09  Jakub Jelinek  <jakub@redhat.com>
+
+       Backported from mainline
+       2011-12-15  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/51517
+       * trans-decl.c (gfc_get_symbol_decl): Don't set DECL_INITAL on span.
+       (gfc_trans_deferred_vars): Instead add its runtime initialization
+       here.
+
 2012-02-08  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/52151
index 50f137287eb417b9c187b5dd0d15411d48512d85..5b5e7881c4d493152ff0910ac38ead32e30c7c37 100644 (file)
@@ -1352,7 +1352,6 @@ gfc_get_symbol_decl (gfc_symbol * sym)
       gfc_finish_var_decl (span, sym);
       TREE_STATIC (span) = TREE_STATIC (decl);
       DECL_ARTIFICIAL (span) = 1;
-      DECL_INITIAL (span) = build_int_cst (gfc_array_index_type, 0);
 
       GFC_DECL_SPAN (decl) = span;
       GFC_TYPE_ARRAY_SPAN (TREE_TYPE (decl)) = span;
@@ -3394,6 +3393,17 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, gfc_wrapped_block * block)
       if (sym->assoc)
        continue;
 
+      if (sym->attr.subref_array_pointer
+         && GFC_DECL_SPAN (sym->backend_decl)
+         && !TREE_STATIC (GFC_DECL_SPAN (sym->backend_decl)))
+       {
+         gfc_init_block (&tmpblock);
+         gfc_add_modify (&tmpblock, GFC_DECL_SPAN (sym->backend_decl),
+                         build_int_cst (gfc_array_index_type, 0));
+         gfc_add_init_cleanup (block, gfc_finish_block (&tmpblock),
+                               NULL_TREE);
+       }
+
       if (sym->attr.dimension)
        {
           /* Assumed-size Cray pointees need to be treated as AS_EXPLICIT.  */
index e7490e6813c53515532b486c5395b43f0f1955aa..40514b4b8de78cf8dad52b5eebd152d2f632be87 100644 (file)
@@ -1373,7 +1373,7 @@ coalesce_ssa_name (void)
 
          if (a
              && SSA_NAME_VAR (a)
-             && !DECL_ARTIFICIAL (SSA_NAME_VAR (a))
+             && !DECL_IGNORED_P (SSA_NAME_VAR (a))
              && (!has_zero_uses (a) || !SSA_NAME_IS_DEFAULT_DEF (a)))
            {
              tree *slot = (tree *) htab_find_slot (ssa_name_hash, a, INSERT);