public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-6772] Fortran: Fix regression caused by PR37336 patch [PR109206]
@ 2023-03-21  6:28 Paul Thomas
  0 siblings, 0 replies; only message in thread
From: Paul Thomas @ 2023-03-21  6:28 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:259bd768640328cc98647c5cf8b0d6dcfba6d4bf

commit r13-6772-g259bd768640328cc98647c5cf8b0d6dcfba6d4bf
Author: Paul Thomas <pault@gcc.gnu.org>
Date:   Tue Mar 21 06:28:07 2023 +0000

    Fortran: Fix regression caused by PR37336 patch [PR109206]
    
    2023-03-21  Paul Thomas  <pault@gcc.gnu.org>
    
    gcc/fortran
            PR fortran/109206
            * trans-array.cc (gfc_trans_array_constructor_value): Correct
            incorrect setting of typespec.

Diff:
---
 gcc/fortran/trans-array.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc
index 7bc0e03dd0d..41661b4195e 100644
--- a/gcc/fortran/trans-array.cc
+++ b/gcc/fortran/trans-array.cc
@@ -2046,6 +2046,7 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock,
   tree shadow_loopvar = NULL_TREE;
   gfc_saved_var saved_loopvar;
 
+  ts.type = BT_UNKNOWN;
   mpz_init (size);
   for (c = gfc_constructor_first (base); c; c = gfc_constructor_next (c))
     {
@@ -2204,7 +2205,9 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock,
               gfc_add_modify (&body, *offsetvar, *poffset);
               *poffset = *offsetvar;
             }
-	  ts = c->expr->ts;
+
+	  if (!c->iterator)
+	    ts = c->expr->ts;
 	}
 
       /* The frontend should already have done any expansions

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-21  6:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-21  6:28 [gcc r13-6772] Fortran: Fix regression caused by PR37336 patch [PR109206] Paul Thomas

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).