From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9F6E338582A1; Tue, 23 Jan 2024 12:52:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9F6E338582A1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706014364; bh=PdahBymZhvg7FseoMPA3nSEuimYpaYJRYeMsEMf9fr8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=G7oTucYPOggEY8hB+AwVf2JwIMTGQ+diRU4hc5Y2ZyK9VxAC89aZ5GtWZzNQOLPmr IiK2m2ZFkv5jKXwbCZxmhej9WlhyyzzJ4h1++ZNYxExT7d2R2kpHJEx5+n8r6EwZme ju9pw1RzGdqnmqXi0HV+PQ+sNj0LYWn0xAT92Ymg= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/113441] [14 Regression] Fail to fold the last element with multiple loop Date: Tue, 23 Jan 2024 12:52:44 +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: 14.0 X-Bugzilla-Keywords: missed-optimization, needs-bisection X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113441 --- Comment #19 from Richard Biener --- (In reply to Richard Biener from comment #18) > (In reply to Tamar Christina from comment #17) > > Ok, bisected to > >=20 > > g:2efe3a7de0107618397264017fb045f237764cc7 is the first bad commit > > commit 2efe3a7de0107618397264017fb045f237764cc7 > > Author: Hao Liu > > Date: Wed Dec 6 14:52:19 2023 +0800 > >=20 > > tree-optimization/112774: extend the SCEV CHREC tree with a nonwrap= ping > > flag > >=20 > > Before this commit we were unable to analyse the stride of the access. > > After this niters seems to estimate the loop trip count at 4 and after = that > > the logs diverge enormously. >=20 > Hum, but that's backward and would match to what I said in comment#2 - we > should get better code with that. >=20 > Juzhe - when you revert the above ontop of trunk does the generated code > look better for Risc-V? It doesn't revert but you can do diff --git a/gcc/tree-scalar-evolution.cc b/gcc/tree-scalar-evolution.cc index 25e3130e2f1..7870c8d76fb 100644 --- a/gcc/tree-scalar-evolution.cc +++ b/gcc/tree-scalar-evolution.cc @@ -2054,7 +2054,7 @@ analyze_scalar_evolution (class loop *loop, tree var) void record_nonwrapping_chrec (tree chrec) { - CHREC_NOWRAP(chrec) =3D 1; + CHREC_NOWRAP(chrec) =3D 0; if (dump_file && (dump_flags & TDF_SCEV)) {=