diff options
author | Jakub Jelinek <jakub@redhat.com> | 2007-08-28 18:08:57 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2007-08-28 18:08:57 +0200 |
commit | 08789087fc452a4857df45553c974fed82e31eb4 (patch) | |
tree | 1e0e4e601cb96fefb0fce70c3fd21e29665cf079 /gcc | |
parent | 92d0af977fea398604540282f2ff2789dd525eaa (diff) | |
download | gcc-08789087fc452a4857df45553c974fed82e31eb4.zip gcc-08789087fc452a4857df45553c974fed82e31eb4.tar.gz gcc-08789087fc452a4857df45553c974fed82e31eb4.tar.bz2 |
re PR fortran/22244 (dimension information is lost for multi-dimension array)
PR fortran/22244
* Make-lang.in (fortran/trans-types.o): Depend on $(FLAGS_H).
* trans-types.c: Include flags.h.
(gfc_get_nodesc_array_type): Add TYPE_DECL TYPE_NAME with
correct bounds and dimensions for packed arrays.
From-SVN: r127864
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/fortran/Make-lang.in | 2 | ||||
-rw-r--r-- | gcc/fortran/trans-types.c | 21 |
3 files changed, 29 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index e2ec1af..dffd31e 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,11 @@ +2007-08-28 Jakub Jelinek <jakub@redhat.com> + + PR fortran/22244 + * Make-lang.in (fortran/trans-types.o): Depend on $(FLAGS_H). + * trans-types.c: Include flags.h. + (gfc_get_nodesc_array_type): Add TYPE_DECL TYPE_NAME with + correct bounds and dimensions for packed arrays. + 2007-08-27 Tobias Burnus <burnus@net-b.de> * simplify.c (gfc_simplify_lgamma): Fix mpfr_lgamma call. diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in index 4a9590a..30320a8 100644 --- a/gcc/fortran/Make-lang.in +++ b/gcc/fortran/Make-lang.in @@ -311,7 +311,7 @@ fortran/trans-decl.o: $(GFORTRAN_TRANS_DEPS) gt-fortran-trans-decl.h \ $(CGRAPH_H) $(TARGET_H) $(FUNCTION_H) $(FLAGS_H) $(RTL_H) $(TREE_GIMPLE_H) \ $(TREE_DUMP_H) fortran/trans-types.o: $(GFORTRAN_TRANS_DEPS) gt-fortran-trans-types.h \ - $(REAL_H) toplev.h $(TARGET_H) + $(REAL_H) toplev.h $(TARGET_H) $(FLAGS_H) fortran/trans-const.o: $(GFORTRAN_TRANS_DEPS) fortran/trans-expr.o: $(GFORTRAN_TRANS_DEPS) fortran/dependency.h fortran/trans-stmt.o: $(GFORTRAN_TRANS_DEPS) fortran/dependency.h diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c index e1cac5d..b7c9c53 100644 --- a/gcc/fortran/trans-types.c +++ b/gcc/fortran/trans-types.c @@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. If not see #include "trans-types.h" #include "trans-const.h" #include "real.h" +#include "flags.h" #if (GFC_MAX_DIMENSIONS < 10) @@ -1232,7 +1233,7 @@ gfc_get_nodesc_array_type (tree etype, gfc_array_spec * as, gfc_packed packed) { /* Fill in the stride and bound components of the type. */ if (known_stride) - tmp = gfc_conv_mpz_to_tree (stride, gfc_index_integer_kind); + tmp = gfc_conv_mpz_to_tree (stride, gfc_index_integer_kind); else tmp = NULL_TREE; GFC_TYPE_ARRAY_STRIDE (type, n) = tmp; @@ -1330,6 +1331,24 @@ gfc_get_nodesc_array_type (tree etype, gfc_array_spec * as, gfc_packed packed) mpz_clear (stride); mpz_clear (delta); + /* In debug info represent packed arrays as multi-dimensional + if they have rank > 1 and with proper bounds, instead of flat + arrays. */ + if (known_stride && write_symbols != NO_DEBUG) + { + tree gtype = etype, rtype, type_decl; + + for (n = as->rank - 1; n >= 0; n--) + { + rtype = build_range_type (gfc_array_index_type, + GFC_TYPE_ARRAY_LBOUND (type, n), + GFC_TYPE_ARRAY_UBOUND (type, n)); + gtype = build_array_type (gtype, rtype); + } + TYPE_NAME (type) = type_decl = build_decl (TYPE_DECL, NULL, gtype); + DECL_ORIGINAL_TYPE (type_decl) = gtype; + } + if (packed != PACKED_STATIC || !known_stride) { /* For dummy arrays and automatic (heap allocated) arrays we |