public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mikael Morin <mikael.morin@sfr.fr>
To: Thomas Koenig <tkoenig@netcologne.de>, fortran@gcc.gnu.org
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [Patch, Fortran] Simplify lbound
Date: Mon, 11 May 2015 13:17:00 -0000	[thread overview]
Message-ID: <5550ABEC.8050909@sfr.fr> (raw)
In-Reply-To: <554FD6E1.8090202@netcologne.de>

Le 11/05/2015 00:08, Thomas Koenig a écrit :
> 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?
> 
For what it's worth, I have looked at it further, and it seems to be
gfc_current_ns not being set to the internal namespace.
A patch like this also removes the error.

Index: frontend-passes.c
===================================================================
--- frontend-passes.c	(révision 223002)
+++ frontend-passes.c	(copie de travail)
@@ -581,6 +581,9 @@ insert_block ()
   else
     ns = inserted_block->ext.block.ns;

+  /* From now on, everything will happen in the inserted block.  */
+  gfc_current_ns = ns;
+
   return ns;
 }

To be honest, both patches look fragile to me. Yours because it leaves
gfc_current_ns to its value, leaving the door open to other problems.
Mine, well, because it's playing with a global variable, with the
possible side-effects this could have.
However, without a better idea, I'm OK with either patch (or both).

Mikael

  reply	other threads:[~2015-05-11 13:17 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
2015-05-11 13:17                 ` Mikael Morin [this message]
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=5550ABEC.8050909@sfr.fr \
    --to=mikael.morin@sfr.fr \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=tkoenig@netcologne.de \
    /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).