From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B37523858D39; Tue, 9 Apr 2024 18:07:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B37523858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712686076; bh=ycC9GdX8VcxwizSsfJ9jtyhBlNKXySYfbevzmSomLhQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Xx4484nLZqcgE3ErDgWa4xXkgzjA2BO0+2c7NtPsV4Re7eON0/g5oRfAtSivmsil+ WUyOGhMn/mPxJS5I3Yh7fVUYxclq6WC4oFFzRQ3qGPOY1WgVjYk5GtPZUdRqzIHpGb sKZ3v5J5HfyU56MWdwRlQbxnHrCTp1gOZJSHfAD0= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114660] Exponentiating by squaring not performed for x * y * y * y * y Date: Tue, 09 Apr 2024 18:07:56 +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 X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on everconfirmed 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=3D114660 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2024-04-09 Ever confirmed|0 |1 --- Comment #3 from Andrew Pinski --- (In reply to Andrew Pinski from comment #2) > We don't do as much reassociation as we should with signed integers due to > overflow. If you use -fwrapv, you get the reassociation; I am 99% sure th= ere > is a dup for this bug too. I should say we also do it for unsigned already (see PR 95867), -fwrapv cas= e we just treat signed similar to unsigned here. Anyways what needs to happen is= we need 2 levels of gimple, one with signed integer overflow behavior and then= one with wrapping behavior. RTL does not distinguish between signed and unsigned behaviors for many operations (plus and multiple) so we get some optimizati= ons there but not all.=