From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 55824386F457; Thu, 11 Feb 2021 18:43:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 55824386F457 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/96264] [10/11 Regression] wrong code with -Os -fno-forward-propagate -fschedule-insns -fno-tree-ter Date: Thu, 11 Feb 2021 18:43:21 +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: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org 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.3 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: Thu, 11 Feb 2021 18:43:21 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96264 --- Comment #9 from Jakub Jelinek --- So, using the r10-135 compiler, seems things go wrong during RA. In *.ira, we have: (insn 35 34 217 2 (parallel [ (set (reg:DI 544 [ _29 ]) (minus:DI (reg:DI 542 [ _26 ]) (reg:DI 123 [ _14 ]))) (set (reg:DI 76 ca) (leu:DI (reg:DI 123 [ _14 ]) (reg:DI 542 [ _26 ]))) ]) "pr96264.c":12:12 107 {subfdi3_carry} (expr_list:REG_DEAD (reg:DI 542 [ _26 ]) (nil))) ... (insn 36 195 37 2 (parallel [ (set (reg:DI 545 [ _29+8 ]) (plus:DI (plus:DI (not:DI (reg:DI 251)) (reg:DI 76 ca)) (reg:DI 543 [ _26+8 ]))) (clobber (reg:DI 76 ca)) ]) "pr96264.c":12:12 111 {*subfdi3_carry_in_internal} (expr_list:REG_DEAD (reg:DI 543 [ _26+8 ]) (expr_list:REG_DEAD (reg:DI 76 ca) (expr_list:REG_UNUSED (reg:DI 76 ca) (expr_list:REG_EQUIV (mem/c:DI (plus:DI (reg/f:DI 522) (const_int 8 [0x8])) [1 S8 A64]) (nil)))))) with lots of insns in between in ... but nothing that would use or set or clobber (reg:DI 76 ca) - including tons of division instructions etc. But in *.reload I see: (insn 35 34 3298 2 (parallel [ (set (reg:DI 7 7 [orig:544 _29 ] [544]) (minus:DI (reg:DI 7 7 [orig:542 _26 ] [542]) (reg:DI 5 5 [orig:123 _14 ] [123]))) (set (reg:DI 76 ca) (leu:DI (reg:DI 5 5 [orig:123 _14 ] [123]) (reg:DI 7 7 [orig:542 _26 ] [542]))) ]) "pr96264.c":12:12 107 {subfdi3_carry} (nil)) ... (insn 193 192 195 2 (set (reg:DI 3 3 [orig:186 _88 ] [186]) (zero_extend:DI (reg:HI 3 3 [366]))) "pr96264.c":13:10 14 {zero_extendhidi2} (nil)) (insn 195 193 3317 2 (set (reg:SI 10 10 [369]) (udiv:SI (reg:SI 10 10 [276]) (reg:SI 3 3 [orig:186 _88 ] [186]))) "pr96264.c":13:10 168 {udivsi3} (nil)) (insn 3317 195 3402 2 (set (reg:DI 3 3 [orig:543 _26+8 ] [543]) (mem/c:DI (plus:DI (reg/f:DI 1 1) (const_int 568 [0x238])) [4 %sfp+568 S8 A64])) "pr96264.c":12:12 608 {*movdi_internal64} (nil)) (insn 3402 3317 3387 2 (parallel [ (set (reg:DI 11 11 [251]) (ashiftrt:DI (reg:DI 5 5 [orig:123 _14 ] [123]) (const_int 63 [0x3f]))) (clobber (reg:DI 76 ca)) ]) "pr96264.c":12:12 275 {ashrdi3} (nil)) (note 3387 3402 36 2 NOTE_INSN_DELETED) (insn 36 3387 3318 2 (parallel [ (set (reg:DI 3 3 [orig:545 _29+8 ] [545]) (plus:DI (plus:DI (not:DI (reg:DI 11 11 [251])) (reg:DI 76 ca)) (reg:DI 3 3 [orig:543 _26+8 ] [543]))) (clobber (reg:DI 76 ca)) ]) "pr96264.c":12:12 111 {*subfdi3_carry_in_internal} (expr_list:REG_EQUIV (mem/c:DI (plus:DI (reg/f:DI 522) (const_int 8 [0x8])) [1 S8 A64]) (nil))) i.e. insn 3402 that clobbers (reg:DI 76 ca) has been added in between the setter of that (insn 35) and user (insn 36). That is why one gets 0x00000000000000010000000000000002 in the third int128 of the result rather than 2.=