From patchwork Wed Nov 10 14:59:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 47413 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5697B385840C for ; Wed, 10 Nov 2021 15:00:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5697B385840C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1636556419; bh=CTy5BEtnBwqiiidRtY8iR19LRgrMLjz7dWW5gSC6caY=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=xupmnKY+ZOMgW0iGoml16ur5HE6FTUOHx/oaNxxi2TWI6Q7t/qSvF1OrhIyKciEWY BSWZlDYDewpTt0ttW55orcKzVbqN5LhcqHll4N/a0EWkFeauEtI0sRPxJzU3SJqMPf azqIcwC0bWpz7wHiF51cmbHNyXK7HpzNKJ1lGlBI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from nikam.ms.mff.cuni.cz (nikam.ms.mff.cuni.cz [195.113.20.16]) by sourceware.org (Postfix) with ESMTPS id 6DF9B3858400 for ; Wed, 10 Nov 2021 14:59:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6DF9B3858400 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 4529528270D; Wed, 10 Nov 2021 15:59:47 +0100 (CET) Date: Wed, 10 Nov 2021 15:59:47 +0100 To: gcc-patches@gcc.gnu.org Subject: Silence additional warning in gfortran.dg/do_subscript_3.f90 Message-ID: <20211110145947.GH97553@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jan Hubicka via Gcc-patches From: Jan Hubicka Reply-To: Jan Hubicka Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi, the testcase tests for out of bound accesses warnings and with ipa-modref improvements it now triggers a new warning: /aux/hubicka/trunk-git/gcc/testsuite/gfortran.dg/do_subscript_3.f90:11:9: Warning: (1) /aux/hubicka/trunk-git/gcc/testsuite/gfortran.dg/do_subscript_3.f90:10:47: Warning: Array reference at (1) out of bounds (0 < 1) in loop beginning at (2) /aux/hubicka/trunk-git/gcc/testsuite/gfortran.dg/do_subscript_3.f90:19:9: Warning: (1) /aux/hubicka/trunk-git/gcc/testsuite/gfortran.dg/do_subscript_3.f90:18:45: Warning: Array reference at (1) out of bounds (6 > 5) in loop beginning at (2) /aux/hubicka/trunk-git/gcc/testsuite/gfortran.dg/do_subscript_3.f90:19:50: Warning: iteration 5 invokes undefined behavior [-Waggressive-loop-optimizations] /aux/hubicka/trunk-git/gcc/testsuite/gfortran.dg/do_subscript_3.f90:18:9: note: within this loop I suppose we now are able to propagate array bounds better into the nested function. The last warning is new and correct even though little bit redundant. I think we may just silence it? I wonder why we do not get same fact on the first loop (which hits out of bound access already at iteration 0). Looks OK? Honza gcc/testsuite/ChangeLog: 2021-11-10 Jan Hubicka * gfortran.dg/do_subscript_3.f90: Add -Wno-aggressive-loop-optimizations. diff --git a/gcc/testsuite/gfortran.dg/do_subscript_3.f90 b/gcc/testsuite/gfortran.dg/do_subscript_3.f90 index 2f62f58142b..18ed9a2f0c9 100644 --- a/gcc/testsuite/gfortran.dg/do_subscript_3.f90 +++ b/gcc/testsuite/gfortran.dg/do_subscript_3.f90 @@ -1,4 +1,5 @@ ! { dg-do compile } +! { dg-additional-options "-Wno-aggressive-loop-optimizations" } ! PR fortran/91424 ! Check that only one warning is issued inside blocks, and that ! warnings are also issued for contained subroutines.