public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Koenig <tkoenig@netcologne.de>
To: fortran@gcc.gnu.org
Cc: gcc-patches <gcc-patches@gcc.gnu.org>,
	 Mikael Morin <mikael.morin@sfr.fr>
Subject: Re: [Patch, Fortran] Simplify lbound
Date: Sun, 10 May 2015 22:08:00 -0000	[thread overview]
Message-ID: <554FD6E1.8090202@netcologne.de> (raw)
In-Reply-To: <CAMe9rOra_hoDhhkrrTzY3VSAo-A+Bww-FgZ1avKVPFWxnie8-Q@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 878 bytes --]

Am 10.05.2015 um 22:43 schrieb H.J. Lu:

>> Here is what I have committed.
>>
> 
> It caused:
> 
> /export/gnu/import/git/sources/gcc/gcc/testsuite/gfortran.dg/inline_matmul_3.f90:38:39:
> Error: Variable 'c1' cannot appear in the expression at (1)^M

I know that error message, I got it when developing the inline
matmul patches with the same test cases.  I had a fix for this
error message in one of my matmul patches, but it was removed
in the review process because it could no longer be reproduced.

So, here is the fix again.  I think it is close to obvious (since it
fixes the problem and can obviously do no harm), but anyway:  OK for
trunk?

Regards

	Thomas

2015-05-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/66041
	PR fortran/37131
	* gfortran.h (gfc_array_spec):  Add field resolved.
	* array.c (gfc_resolve_array_spec):  Resolve array spec
	only once.


[-- Attachment #2: p-fix.diff --]
[-- Type: text/x-patch, Size: 866 bytes --]

Index: array.c
===================================================================
--- array.c	(Revision 222984)
+++ array.c	(Arbeitskopie)
@@ -338,6 +338,9 @@ gfc_resolve_array_spec (gfc_array_spec *as, int ch
   if (as == NULL)
     return true;
 
+  if (as->resolved)
+    return true;
+
   for (i = 0; i < as->rank + as->corank; i++)
     {
       e = as->lower[i];
@@ -364,6 +367,8 @@ gfc_resolve_array_spec (gfc_array_spec *as, int ch
 	}
     }
 
+  as->resolved = true;
+
   return true;
 }
 
Index: gfortran.h
===================================================================
--- gfortran.h	(Revision 222984)
+++ gfortran.h	(Arbeitskopie)
@@ -1002,6 +1002,8 @@ typedef struct
   bool cp_was_assumed; /* AS_ASSUMED_SIZE cp arrays are converted to
 			AS_EXPLICIT, but we want to remember that we
 			did this.  */
+
+  bool resolved;
 }
 gfc_array_spec;
 

  reply	other threads:[~2015-05-10 22:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-25 11:34 Thomas Koenig
2015-04-25 18:13 ` Mikael Morin
2015-04-27 18:45   ` Thomas Koenig
2015-04-27 19:22     ` Thomas Koenig
2015-04-30 18:46     ` Mikael Morin
2015-05-01 21:04       ` Mikael Morin
2015-05-03 20:38         ` Thomas Koenig
2015-05-10 13:59           ` Mikael Morin
2015-05-10 20:43             ` H.J. Lu
2015-05-10 22:08               ` Thomas Koenig [this message]
2015-05-11 13:17                 ` Mikael Morin
2015-05-12  7:08                   ` Thomas Koenig
2015-05-12 10:04                     ` Mikael Morin
2015-05-02 10:50     ` H.J. Lu

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=554FD6E1.8090202@netcologne.de \
    --to=tkoenig@netcologne.de \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mikael.morin@sfr.fr \
    /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).