From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 75EA7385781C; Wed, 7 Oct 2020 14:51:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 75EA7385781C From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/97307] Optimization for pure vs. const function Date: Wed, 07 Oct 2020 14:51:46 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 10.2.1 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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: Wed, 07 Oct 2020 14:51:46 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97307 --- Comment #3 from Richard Biener --- The patch will cause FAIL: gcc.dg/vect/pr65947-3.c scan-tree-dump-times vect "LOOP VECTORIZED" 2 since the testcase has exactly such a pattern: unsigned int condition_reduction (unsigned int *a, unsigned int min_v, unsigned int *b) { unsigned int last =3D N + 65; unsigned int aval; for (unsigned int i =3D 0; i < N; i++) { aval =3D a[i]; if (b[i] < min_v) last =3D aval; } return last; } and sinking the aval =3D a[i] load causes if-conversion to no longer happen because a[i] now appears to only conditionally trap. It will be vectorized with masked loads if those are available though, so I'm considering to XFAIL it for the moment.=