From patchwork Tue Aug 13 18:50:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Koenig X-Patchwork-Id: 1146592 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-506847-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=netcologne.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="jK3r1oC/"; dkim=pass (2048-bit key; unprotected) header.d=netcologne.de header.i=@netcologne.de header.b="I2BcVtCJ"; dkim-atps=neutral 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 467MH72NVyz9sML for ; Wed, 14 Aug 2019 04:50:41 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=GeIesR+YXw/DIjAvxwxZOlz4R6FENQwyAP/QK0gbO63EV68Go8 7YGeu5uW1xiOCUEXd1VXaDpVJRMZxJGVSXp+nPXx0gTTzfL3uMASrNxdJaYU/gON GEmRnSbi4bV5qZ7+NRPENHMLU1r5Y7JQ5KVbvG3l86KesXFNGGJ3Ke/g0= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=tlrYQwQ6hgQZyysgdsrl0ia9cak=; b=jK3r1oC/1iPyKswnO1Y9 73T+/vdiBJ1rM6Np7wJFw9AqOQ918Dhu3YWqsAkefvMJryvVU+0ciyFQ6dJ0ekq1 AgssCW3FNzN9s0oyZzibZHOPsrqbfboG6vkdcMaUdTz4na6bO1ETLjqcKH2JOHRb x8aV3xv9zFFYe6wiLcf4H0k= Received: (qmail 75843 invoked by alias); 13 Aug 2019 18:50:33 -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 75827 invoked by uid 89); 13 Aug 2019 18:50:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-12.6 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: cc-smtpout1.netcologne.de Received: from cc-smtpout1.netcologne.de (HELO cc-smtpout1.netcologne.de) (89.1.8.211) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 13 Aug 2019 18:50:31 +0000 Received: from cc-smtpin2.netcologne.de (cc-smtpin2.netcologne.de [89.1.8.202]) by cc-smtpout1.netcologne.de (Postfix) with ESMTP id BBB111339F; Tue, 13 Aug 2019 20:50:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=netcologne.de; s=nc1116a; t=1565722228; bh=KycUgsf5QpGIR35TiIsbjVLwHN/enej8iDb1zI35m0E=; h=To:From:Subject:Message-ID:Date:From; b=I2BcVtCJqFjJ5Q7aJM5LQbGRQDesz0ATDDXmSJH5aW69wuRh7LsClIgwNyrELVR/1 /AI9ge1027UbIzlLIqXr+e0cT6m5oQdTEKTvmObK5oMtOsN0zPp2OTp3OO2MuniZzO Qj4OdKDrXnsT7TgxTxbKSQVOYECjFmRyqWrCIQhebESLIyiaM1Sqios/FPinuOoAOz 8lvjds2dfyq7HPY/BPjiWFFwvtVuw8uCgGnZaI/PkUR1kOut8dYa8OTZDXmr1uyhe9 IRN82OhAKoas9+uxE8+ZopZFjOXGXRv6TAosaVttiC8wd5Kg04bcaO8i6R/gdOQaSX Q6nrGt0v9PDQQ== Received: from localhost (localhost [127.0.0.1]) by cc-smtpin2.netcologne.de (Postfix) with ESMTP id AD4C811E69; Tue, 13 Aug 2019 20:50:28 +0200 (CEST) Received: from [2001:4dd6:e4c:0:7285:c2ff:fe6c:992d] (helo=cc-smtpin2.netcologne.de) by localhost with ESMTP (eXpurgate 4.6.0) (envelope-from ) id 5d530674-669a-7f0000012729-7f0000019224-1 for ; Tue, 13 Aug 2019 20:50:28 +0200 Received: from [IPv6:2001:4dd6:e4c:0:7285:c2ff:fe6c:992d] (2001-4dd6-e4c-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de [IPv6:2001:4dd6:e4c:0:7285:c2ff:fe6c:992d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by cc-smtpin2.netcologne.de (Postfix) with ESMTPSA; Tue, 13 Aug 2019 20:50:27 +0200 (CEST) To: "fortran@gcc.gnu.org" , gcc-patches From: Thomas Koenig Subject: [patch, fortran, committed] Fix PR 90563, error while warning about do subscripts Message-ID: <8cc23159-6c8e-9a88-eeb6-bb3e36453d78@netcologne.de> Date: Tue, 13 Aug 2019 20:50:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 Hi, I just committed as simple and obvious the patch below. This fixes a 8/9/10 regression where a false positive with -Wdo-subscript (which we know about) was compounded by an also invalid error. Fixed by suppressing errors at the right time. I will also commit the patch to the other affected branches. Regards Thomas 2013-08-13 Thomas Koenig PR fortran/90563 * frontend-passes.c (insert_index): Suppress errors while simplifying the resulting expression. 2013-08-13 Thomas Koenig PR fortran/90563 * gfortran.dg/do_subsript_5.f90: New test. Index: testsuite/gfortran.dg/do_subscript_5.f90 =================================================================== --- testsuite/gfortran.dg/do_subscript_5.f90 (Revision 274394) +++ testsuite/gfortran.dg/do_subscript_5.f90 (Arbeitskopie) @@ -1,4 +1,5 @@ ! { dg-do compile } +! { dg-additional-options "-Wdo-subscript" } ! PR 90563 - this used to be rejected, wrongly ! Original test case by Tobias Neumann program test @@ -9,9 +10,11 @@ p = 0.0 - do j=1,6 + ! The following warnings are actually bogus, but we are not yet + ! clever enough to suppress them. + do j=1,6 ! { dg-warning "out of bounds" } if (j<5) then - p(j) = p(swap(j)) + p(j) = p(swap(j)) ! { dg-warning "out of bounds" } endif enddo end program