re PR debug/51517 (Wrong debug information for pointers with negative strides.)
authorJakub Jelinek <jakub@gcc.gnu.org>
Thu, 15 Dec 2011 11:05:37 +0000 (12:05 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 15 Dec 2011 11:05:37 +0000 (12:05 +0100)
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.

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

From-SVN: r182362

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

index 5dfad7bdb3f72f1aa85449c779df6d4ab364c0f7..40c96462f57e16b2084af85cce210dea1606bb67 100644 (file)
@@ -1,3 +1,9 @@
+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-12-15  Richard Guenther  <rguenther@suse.de>
 
        Revert
index 2cab0db376c4ce4ec18041912920bb4afd008633..40e01f33f485e9b1a0407abc4fe6e3eb777fe4fa 100644 (file)
@@ -1,3 +1,10 @@
+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.
+
 2011-12-11  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/50923
@@ -15,7 +22,7 @@
        PR fortran/46356
        PR fortran/46990
        PR fortran/49074
-       * interface.c(symbol_rank): Return the rank of the _data
+       * interface.c (symbol_rank): Return the rank of the _data
        component of class objects.
        (compare_parameter): Also compare the derived type of the class
        _data component for type mismatch.  Similarly, return 1 if the
        Also unset codimension.
        (gfc_find_derived_vtab): Make 'copy' elemental and set the
        intent of the arguments accordingly.: 
-       * trans-array.h : Update prototype for gfc_array_allocate.
+       * trans-array.h: Update prototype for gfc_array_allocate.
        * array.c (gfc_array_dimen_size): Return failure if class expr.
        (gfc_array_size): Likewise.
-       * gfortran.h : New prototypes for gfc_add_class_array_ref,
+       * gfortran.h: New prototypes for gfc_add_class_array_ref,
        gfc_is_class_array_ref and gfc_is_class_scalar_expr.
        * trans-stmt.c (trans_associate_var): Exclude class targets
        from test. Move the allocation of the _vptr to an earlier time
@@ -82,7 +89,7 @@
        * expr.c (gfc_get_corank): Fix for BT_CLASS.
        (gfc_is_simply_contiguous): Exclude class from test.
        * trans.c (gfc_build_array_ref): Include class array refs.
-       * trans.h : Include prototypes for class API functions that are
+       * trans.h: Include prototypes for class API functions that are
        new in trans-expr. Define GFC_DECL_CLASS(node).
        * resolve.c (check_typebound_baseobject ): Remove error for
        non-scalar base object.
        changed to GFC_ENABLE_REVERSE.
        * trans-array.c (gfc_init_loopinfo): GFC_CANNOT_REVERSE changed
        to GFC_INHIBIT_REVERSE.
-       * gfortran.h : Enum gfc_reverse is now GFC_ENABLE_REVERSE,
+       * gfortran.h: Enum gfc_reverse is now GFC_ENABLE_REVERSE,
        GFC_FORWARD_SET, GFC_REVERSE_SET and GFC_INHIBIT_REVERSE.
        * dependency.c (gfc_dep_resolver): Change names for elements of
        gfc_reverse as necessary. Change the logic so that forward
 2011-03-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR fortran/22572
-       * gfortran.h (gfc_option_t) : Add
+       * gfortran.h (gfc_option_t): Add
        flag_aggressive_function_elimination.
        (gfc_dep_compare_functions):  Add prototype.
        * lang.opt: Add faggressive-function-elimination.
        PR fortran/44945
        * trans-types.c (gfc_get_derived_type): Remove code that looks
        for decls in gsym and add call to gfc_get_module_backend_decl.
-       * trans.h : Add prototype for gfc_get_module_backend_decl.
+       * trans.h: Add prototype for gfc_get_module_backend_decl.
        * trans-decl.c (gfc_get_module_backend_decl): New function.
        (gfc_get_symbol_decl): Call it.
 
        is called before reallocation, so that the length is available.
        (gfc_trans_asssignment): Remove error about assignment to
        deferred length character variables.
-       * gfortran.texi : Update entry about (re)allocation on
+       * gfortran.texi: Update entry about (re)allocation on
        assignment.
        * trans-stmt.c (gfc_trans_allocate): Add code to handle deferred
        length character variables.
        implicit pureness of containing procedure.
        * decl.c (match_old_style_init, gfc_match_data): Where decl
        would fail in PURE procedure, set implicit_pure to zero.
-       * gfortran.h : Add implicit_pure to structure symbol_attr and
+       * gfortran.h: Add implicit_pure to structure symbol_attr and
        add prototype for function gfc_implicit_pure.
        * expr.c (gfc_check_pointer_assign, gfc_check_vardef_context):
        Where decl would fail in PURE procedure, reset implicit_pure.
        * parse.c (decode_omp_directive): The same.
        (parse_contained): If not PURE, set implicit pure attribute.
        * resolve.c (resolve_formal_arglist, resolve_structure_cons,
-       resolve_function, resolve_ordinary_assign) : The same.
+       resolve_function, resolve_ordinary_assign): The same.
        (gfc_implicit_pure): New function.
        * module.c (mio_symbol_attribute): Introduce AB_IMPLICIT_PURE
        to ab_attribute enum and use it in this function.
index 9733a6f94a08c736de385b166677f85eb4f151de..78b7011466d0eff1833b7dc82557eadd126924b3 100644 (file)
@@ -1434,7 +1434,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;
@@ -3577,6 +3576,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 || sym->attr.codimension)
        {
           /* Assumed-size Cray pointees need to be treated as AS_EXPLICIT.  */
index 2dfe37eca534b5432d2b6f696b9138cc7c009d1e..776e9e02e77465f22c6b0c03439e067763eca7d3 100644 (file)
@@ -1,5 +1,5 @@
 /* Coalesce SSA_NAMES together for the out-of-ssa pass.
-   Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
+   Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
    Contributed by Andrew MacLeod <amacleod@redhat.com>
 
@@ -1372,7 +1372,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);