From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 729E1395BC2B; Tue, 4 May 2021 15:14:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 729E1395BC2B From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/100342] [10/11 Regression] wrong code with -O2 -fno-dse -fno-forward-propagate -mno-sse2 Date: Tue, 04 May 2021 15:14:01 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 11.1.1 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: ubizjak at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.4 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: Tue, 04 May 2021 15:14:01 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100342 --- Comment #5 from Uro=C5=A1 Bizjak --- The problem can be seen in _.pro_and_epilogue pass: Starting with: _.cmpelim 2741: r14:DI=3D[sp:DI+0x38] ... 368: di:DI=3Dr14:DI ... 613: si:QI=3Dr14:QI ... 2737: bp:DI=3Dr14:DI ... 658: strict_low_part(ax:QI)=3Dbp:QI 2275: dx:DI=3Dsi:DI ... 2287: dx:DI=3Dbp:DI 710: dx:DI=3Dbswap(dx:DI) The pass converts: _.pro_and_epilogue rescanning insn with uid =3D 658. insn 658: replaced reg 6 with 4 verify found no changes in insn with uid =3D 658. verify found no changes in insn with uid =3D 2275. deleting insn with uid =3D 2287. 2741: r14:DI=3D[sp:DI+0x38] ... 368: di:DI=3Dr14:DI ... 613: si:QI=3Dr14:QI ... 2737: bp:DI=3Dr14:DI ... 658: strict_low_part(ax:QI)=3Dsi:QI 2275: dx:DI=3Dsi:DI ... 2287: ? 710: dx:DI=3Dbswap(dx:DI) Please note how the optimization removes insn 2287, assuming that rsi holds= the whole 64bit value ... Which is not true!=