From: Jakub Jelinek Date: Tue, 23 Sep 2014 15:25:55 +0000 (+0200) Subject: re PR fortran/63331 (Fortran -fcompare-debug issues) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=54f9184b594d38d288471029277733a0c3374a65;p=gcc.git re PR fortran/63331 (Fortran -fcompare-debug issues) PR fortran/63331 * trans-types.c (gfc_get_array_descr_info): Build DEBUG_EXPR_DECL instead of VAR_DECL for base_decl. * gfortran.dg/pr63331.f90: New test. From-SVN: r215516 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 245a554d521..214e10112a4 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2014-09-23 Jakub Jelinek + + PR fortran/63331 + * trans-types.c (gfc_get_array_descr_info): Build DEBUG_EXPR_DECL + instead of VAR_DECL for base_decl. + 2014-09-21 Jan Hubicka * openmp.c (omp_context): Rename to ... diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c index 032147deafc..6bfe14c740c 100644 --- a/gcc/fortran/trans-types.c +++ b/gcc/fortran/trans-types.c @@ -3041,8 +3041,10 @@ gfc_get_array_descr_info (const_tree type, struct array_descr_info *info) base_decl = GFC_TYPE_ARRAY_BASE_DECL (type, indirect); if (!base_decl) { - base_decl = build_decl (input_location, VAR_DECL, NULL_TREE, - indirect ? build_pointer_type (ptype) : ptype); + base_decl = make_node (DEBUG_EXPR_DECL); + DECL_ARTIFICIAL (base_decl) = 1; + TREE_TYPE (base_decl) = indirect ? build_pointer_type (ptype) : ptype; + DECL_MODE (base_decl) = TYPE_MODE (TREE_TYPE (base_decl)); GFC_TYPE_ARRAY_BASE_DECL (type, indirect) = base_decl; } info->base_decl = base_decl; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c354a42d475..c7be6d91646 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-09-23 Jakub Jelinek + + PR fortran/63331 + * gfortran.dg/pr63331.f90: New test. + 2014-09-24 Renlin Li * gcc.dg/ira-shrinkwrap-prep-1.c: Enable aarch64. diff --git a/gcc/testsuite/gfortran.dg/pr63331.f90 b/gcc/testsuite/gfortran.dg/pr63331.f90 new file mode 100644 index 00000000000..1ea612b832d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr63331.f90 @@ -0,0 +1,5 @@ +! PR fortran/63331 +! { dg-do compile } +! { dg-options "-fcoarray=single -fcompare-debug" } + +include 'intent_out_7.f90'