From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9FBCA386188D; Tue, 16 Feb 2021 18:30:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9FBCA386188D From: "pipcet at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/99114] [WORD_REGISTER_OPERATIONS] wrong code for (u16_var & 3) == (u32)1 Date: Tue, 16 Feb 2021 18:30:57 +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.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pipcet at gmail dot com X-Bugzilla-Status: WAITING 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: attachments.created 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, 16 Feb 2021 18:30:58 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99114 --- Comment #6 from pipcet at gmail dot com --- Created attachment 50204 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D50204&action=3Dedit RTL dump of combine pass (Gzipped because of the file size limit). The relevant section is around this code: (note 4724 4779 4727 667 [bb 667] NOTE_INSN_BASIC_BLOCK) (note 4727 4724 4728 667 NOTE_INSN_DELETED) (note 4728 4727 4729 667 NOTE_INSN_DELETED) (jump_insn 4729 4728 4730 667 (set (pc) (if_then_else (gtu (subreg:SI (reg:HI 799 [ hrsi$word_no ]) 0) (const_int 1 [0x1])) (label_ref 4783) (pc))) "../../../src/gcc/gcc/hard-reg-set.h":311:7 20 {*cbranch= si4} (int_list:REG_BR_PROB 39298956 (nil)) -> 4783) allowing combination of insns 4727 and 4728 original costs 4 + 4 =3D 8 replacement cost 4 deferring deletion of insn with uid =3D 4727. modifying insn i3 4728: r2326:SI=3Dr799:HI#0&0x3 deferring rescan insn with uid =3D 4728. allowing combination of insns 4728 and 4729 original costs 4 + 4 =3D 8 replacement cost 4 deferring deletion of insn with uid =3D 4728. modifying insn i3 4729: pc=3D{(gtu(r799:HI#0,0x1))?L4783:pc} REG_BR_PROB 39298956 deferring rescan insn with uid =3D 4729.=