* Re: Silence additional warning in gfortran.dg/do_subscript_3.f90
[not found] <20211110145947.GH97553@kam.mff.cuni.cz>
@ 2021-11-11 7:18 ` Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2021-11-11 7:18 UTC (permalink / raw)
To: Jan Hubicka; +Cc: GCC Patches, fortran
On Wed, Nov 10, 2021 at 4:00 PM Jan Hubicka via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> 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?
I guess so - but it looks like the testcase exercises diagnostics in
the frontend so I wonder
whether simply using { dg-options "-O0" } might be more appropriate?
> Honza
>
> gcc/testsuite/ChangeLog:
>
> 2021-11-10 Jan Hubicka <hubicka@ucw.cz>
>
> * 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.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-11-11 7:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20211110145947.GH97553@kam.mff.cuni.cz>
2021-11-11 7:18 ` Silence additional warning in gfortran.dg/do_subscript_3.f90 Richard Biener
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).