From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 70D8D3858D32; Mon, 26 Jun 2023 21:32:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 70D8D3858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687815159; bh=+aFtxqVN6/63vq1GEt7szS2A4sCywXvsNdYW2uZS74k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=uuwnfjSNZ5l7/oT74nIezl8/215Oi9+PuNdbg4BePT+sXq96wj78YtKbyDN/Q1kft zfCl9BG/SMOEdk6dT9qw0+x3aqMgQj7jRZtUsz+NLDln7Ybu9msKcYmIk8XVEU5kFL 1vU+/EwGANSZLp+rgVbMpxhklmTKPucR5jPcaoT4= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110410] [14 Regression] Different results between -O0 and -O2 Date: Mon, 26 Jun 2023 21:32:39 +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, wrong-code X-Bugzilla-Severity: normal 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: 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=3D110410 --- Comment #6 from Andrew Pinski --- (In reply to Jw Zeng from comment #3) > (In reply to Richard Biener from comment #2) > > phi-opt again? >=20 > Link to the Compiler Explorer:https://godbolt.org/z/EeEqMGnWo >=20 > I reduced the code again, I hope it helps. The reduced code is as follows: This reduced testcase is the same issue except it is dom2 which has the mis= sed optimization: Exported global range table: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D _3 : [irange] int [0, 65535] NONZERO 0xffff _7 : [irange] int [0, 65535] NONZERO 0xffff iftmp.0_16 : [irange] unsigned int [0, 1][2147483648, +INF] iftmp.7_21 : [irange] unsigned int [0, 0][2147483648, +INF] iftmp.7_22 : [irange] unsigned int [0, 0] NONZERO 0x0 Note the reason why dom3 is able to figure out: # VUSE <.MEM_18(D)> var_3.9_9 =3D var_3; is the same as var_3.3_2 and not fre3 is because a jump threading is needed to happen before. Once d= om3 is already to figure that out, it becomes obvious that is _22 is 0 and such= .=