From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C100B3857C57; Mon, 6 Jul 2020 14:24:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C100B3857C57 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1594045440; bh=XDyHj7RG+VgE7GToQBObYLOCUpVLDjDktD0Zn36pqE4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=YYcPsqmfsnuFZJ4KjlNTpcRHmOpmoqy4wYvYMEuR8r5xXW+zrT9FkiSXvlDoCv6pO cZDxlZ2FVgdI0MQt0jkeLv7SqRSwg9Ajed6jAVvVem6lvL1pVVsCJA/bAEENtRBsFK 4XTbksI1GKeV3xa7pmydIpDGsayYoiilxB5n0otM= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/96018] [9/10/11 Regression] Optimization issue with external HDF5 library Date: Mon, 06 Jul 2020 14:24:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: needs-bisection, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 9.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: keywords Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2020 14:24:00 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96018 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |needs-bisection --- Comment #11 from Richard Biener --- So on trunk I get with -O2 (with or without -fno-inline) > ./a.out=20 write text write text 3d works write text 4d does not and with -O0 > ./a.out=20 write text write text 3d works write text write text 4d does not where write_4d is optimized to write_4d () { [local count: 1073741824]: # .MEM_22 =3D VDEF <.MEM_1(D)> call_side_effect (); [tail call] # VUSE <.MEM_22> return; } the interesting fact is that inner_4d is computed "pure" (no side-effects) while inner_3d is not and this is so from the start so done by the FE.=