public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Cc: fortran@gcc.gnu.org
Subject: [PATCH] Fix PR70937
Date: Fri, 06 May 2016 11:19:00 -0000	[thread overview]
Message-ID: <alpine.LSU.2.11.1605061318100.13384@t29.fhfr.qr> (raw)


The following patch fixes another case of missing DECL_EXPR in the FE.

Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.

Ok for trunk?

Thanks,
Richard.

2016-05-06  Richard Biener  <rguenther@suse.de>

	PR fortran/70937
	* trans-decl.c (gfc_trans_vla_type_sizes): Add a DECL_EXPR for
	the TYPE_DECL as well.

	* gfortran.dg/pr70937.f90: New testcase.

Index: gcc/fortran/trans-decl.c
===================================================================
*** gcc/fortran/trans-decl.c	(revision 235945)
--- gcc/fortran/trans-decl.c	(working copy)
*************** gfc_trans_vla_type_sizes (gfc_symbol *sy
*** 3818,3823 ****
--- 3818,3828 ----
      }
  
    gfc_trans_vla_type_sizes_1 (type, body);
+   /* gfc_build_qualified_array may have built this type but left TYPE_NAME
+      pointing to the original type whose type sizes we need to expose to
+      the gimplifier unsharing.  */
+   if (TYPE_NAME (type))
+     gfc_add_expr_to_block (body, build1 (DECL_EXPR, type, TYPE_NAME (type)));
  }
  
  
Index: gcc/testsuite/gfortran.dg/pr70937.f90
===================================================================
*** gcc/testsuite/gfortran.dg/pr70937.f90	(revision 0)
--- gcc/testsuite/gfortran.dg/pr70937.f90	(working copy)
***************
*** 0 ****
--- 1,10 ----
+ ! { dg-do compile }
+ ! { dg-options "-flto" }
+   SUBROUTINE dbcsr_test_read_args(narg, args)
+     CHARACTER(len=*), DIMENSION(:), &
+       INTENT(out)         :: args
+     CHARACTER(len=80)     :: line
+     DO
+        args(narg) = line
+     ENDDO
+   END SUBROUTINE dbcsr_test_read_args

             reply	other threads:[~2016-05-06 11:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-06 11:19 Richard Biener [this message]
2016-05-06 11:29 ` Richard Biener
2016-05-09  7:41   ` Richard Biener
2016-05-10 17:43     ` Jerry DeLisle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LSU.2.11.1605061318100.13384@t29.fhfr.qr \
    --to=rguenther@suse.de \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).