From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 112350 invoked by alias); 11 May 2015 13:17:53 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 111476 invoked by uid 89); 11 May 2015 13:17:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: smtp22.services.sfr.fr Received: from smtp22.services.sfr.fr (HELO smtp22.services.sfr.fr) (93.17.128.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 11 May 2015 13:17:51 +0000 Received: from filter.sfr.fr (localhost [86.72.15.254]) by msfrf2202.sfr.fr (SMTP Server) with ESMTP id 2990B700047D; Mon, 11 May 2015 15:17:48 +0200 (CEST) Authentication-Results: sfrmc.priv.atos.fr; dkim=none (no signature); dkim-adsp=none (no policy) header.from=mikael.morin@sfr.fr Received: from tolstoi.localhost (254.15.72.86.rev.sfr.net [86.72.15.254]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by msfrf2202.sfr.fr (SMTP Server) with ESMTP id CDEF27000295; Mon, 11 May 2015 15:17:47 +0200 (CEST) X-SFR-UUID: 20150511131747843.CDEF27000295@msfrf2202.sfr.fr Message-ID: <5550ABEC.8050909@sfr.fr> Date: Mon, 11 May 2015 13:17:00 -0000 From: Mikael Morin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Thomas Koenig , fortran@gcc.gnu.org CC: gcc-patches Subject: Re: [Patch, Fortran] Simplify lbound References: <553B7BA4.6040103@netcologne.de> <553BD925.3050401@sfr.fr> <553E83B4.8020005@netcologne.de> <5542722E.3030307@sfr.fr> <5543EA34.6060304@sfr.fr> <5546872F.7040507@netcologne.de> <554F640D.5020506@sfr.fr> <554FD6E1.8090202@netcologne.de> In-Reply-To: <554FD6E1.8090202@netcologne.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2015-05/txt/msg00919.txt.bz2 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