From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B8A113858D28; Sun, 10 Oct 2021 01:05:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B8A113858D28 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102622] [9/10/12 Regression] Wrong code with -O1 and above due to phiopt and signed one bit integer types Date: Sun, 10 Oct 2021 01:05:09 +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: 12.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: pinskia at gcc dot gnu.org X-Bugzilla-Target-Milestone: 9.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: target_milestone cf_known_to_work cf_known_to_fail short_desc 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: Sun, 10 Oct 2021 01:05:11 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102622 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|12.0 |9.5 Known to work|9.3.0 |11.1.0, 4.9.2, 7.1.0, 8.5.0 Known to fail| |10.3.0, 9.1.0, 9.4.0 Summary|[12 Regression] Wrong code |[9/10/12 Regression] Wrong |with -O3 for skylake-avx512 |code with -O1 and above due |and icelake-server by |to phiopt and signed one |r12-3903 |bit integer types --- Comment #17 from Andrew Pinski --- So the reason why we didn't hit it in GCC 11 (and before) was the order of = the following was swapped in phiopt compared to what it is in match.pd now: a ? -1 : 0 -> -a a ? powerof2cst : 0 -> a << (log2(powerof2cst)) That is did the powerof2cst case before it did the -1 case. I am going to = test that to see if it works here which I think it does. In fact my new testcase fails in GCC 9.1.0-10.3.0 :). I am going to fix this for the trunk and come up with a fix for the other branches later on. And yes the regression markers are a bit off right now but that is because = the bug is not latent on the 12 branch.=