From patchwork Sat Dec 6 19:48:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mikael Morin X-Patchwork-Id: 418412 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 73CEC14010B for ; Sun, 7 Dec 2014 06:48:47 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type; q=dns; s=default; b=c30yXv/GAmCJ1+6r8 CV9XmxNF5XdNC1Kg4IUv6rABfPg8wVuX7Jr8KN+vws/qD0/017K6pAYnYhqKd+gJ ZMrotvpRz7fDwjcLqt6YzfDfMf3HROsbs4qLhagROamkuJf9oJccHwbVK3Id9JAX oFatqExkqOsY/CtiNiw3uUorRk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type; s=default; bh=QLf6/YWtod7zhjwUvIH3xCi 1hwo=; b=im9RTcQKzkhpJL7JTcLClaZniS1eD468UBJ7e1+8J+DHaey46cyM40H fD/fgPqN7om1c+qa0abK/jGtzZYuZ3V0wzdkxjbbsiiX79V5bMD+PKc98iEubwGU waEzgtsabS0e/8PfABjIuURcLoBSuu4g6PCgp1ZZCvoA6xkPtCgQ= Received: (qmail 25400 invoked by alias); 6 Dec 2014 19:48:39 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 25383 invoked by uid 89); 6 Dec 2014 19:48:39 -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 ESMTP; Sat, 06 Dec 2014 19:48:37 +0000 Received: from filter.sfr.fr (localhost [86.72.15.170]) by msfrf2219.sfr.fr (SMTP Server) with ESMTP id 32C4570000FC; Sat, 6 Dec 2014 20:48:35 +0100 (CET) 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 (170.15.72.86.rev.sfr.net [86.72.15.170]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by msfrf2219.sfr.fr (SMTP Server) with ESMTP id BB0377000051; Sat, 6 Dec 2014 20:48:34 +0100 (CET) X-SFR-UUID: 20141206194834766.BB0377000051@msfrf2219.sfr.fr Message-ID: <54835D92.9060103@sfr.fr> Date: Sat, 06 Dec 2014 20:48:34 +0100 From: Mikael Morin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Manuel =?iso-8859-1?b?TPNwZXotSWLh8WV6?= , Gcc Patch List , "fortran@gcc.gnu.org List" , Tobias Burnus Subject: Re: [RFC PATCH fortran/diagnostics] Move gfc_error (buffered) to common diagnostics References: In-Reply-To: X-IsSubscribed: yes Le 06/12/2014 14:38, Manuel López-Ibáñez a écrit : > * Tobias or other Fortran maintainers. The only test failing is > gfortran.dg/do_iterator.f90 line 7. The old code gives an Error there, > which the new one does not. > > /home/manuel/test1/pristine/gcc/testsuite/gfortran.dg/do_iterator.f90:7.9: > > READ(5,*) I ! { dg-error "cannot be redefined" "changing do-iterator 2" } > 1 > Error: Invalid character in name at (1) > > It seems that the gfc_error above is buffered first, then it is > cleared, however, the old code does not actually clear the text only > clears error_buffer.flag, then a gfc_error_now is emitted, which sets > error_buffer.flag (?!), the next gfc_error_check then emits the text > that was still in the buffer. Is this intended to work like this? If > so, then this patch needs more work. > I agree with Tobias: this error is certainly bogus. For what it's worth, I've had a set of unfinished diagnostic patches, whose first one (attached) was taking care of this very error. Mikael commit 02000ad2b84f3f833bf26d74e055811266d348da Author: Mik Date: Thu Aug 15 12:39:05 2013 +0200 io.c (match_io_element): appel a gfc_check_do_variable non fatal diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c index cc5ce12..196e4d5 100644 --- a/gcc/fortran/io.c +++ b/gcc/fortran/io.c @@ -3106,8 +3106,8 @@ match_io_element (io_kind k, gfc_code **cpp) io_kind_name (k)); } - if (m == MATCH_YES && k == M_READ && gfc_check_do_variable (expr->symtree)) - m = MATCH_ERROR; + if (m == MATCH_YES && k == M_READ) + gfc_check_do_variable (expr->symtree); if (m != MATCH_YES) { diff --git a/gcc/testsuite/gfortran.dg/do_iterator.f90 b/gcc/testsuite/gfortran.dg/do_iterator.f90 index cb3e50d..e1fa18b 100644 --- a/gcc/testsuite/gfortran.dg/do_iterator.f90 +++ b/gcc/testsuite/gfortran.dg/do_iterator.f90 @@ -10,4 +10,3 @@ DO I=1,5 ! { dg-error "cannot be redefined" "changing do-iterator 3" } READ(5,*,iostat=i) j ! { dg-error "cannot be redefined" "changing do-iterator 3" } ENDDO END -! { dg-error "Invalid character" "character" { target *-*-* } 7 }