From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3F48D3858D38; Fri, 9 Sep 2022 09:05:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3F48D3858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662714330; bh=rzVn3Eh4bA6rIbbY6jmeYnfqoNDt5GyJ58iHEZAhjsU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=eragfUk2Uoic1sYfQ+NfMuNFrddzTts4KH031uFd/QpG7Ufmwu0yue7jk36OLEvwy TRgwOs58FE3q0c4cWPt1CsdrgC6ZvFKVCECxg1XVEamBRJ4ottlNWNPbY6MoJ7lT36 6y/g3ZyGOl8YIapcB2vvLF9nKir7RxSPpJINjo40= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/106892] [11/12/13 Regression] Wrong code at -O3 on x86_64-linux-gnu since r11-963-g80d6f89e78fc3b77 Date: Fri, 09 Sep 2022 09:05:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: assigned_to bug_status 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=3D106892 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot = gnu.org Status|NEW |ASSIGNED --- Comment #8 from Richard Biener --- -fno-gcse-lm fixes the testcase. The only difference from the bisected revision is (insn 56 55 57 15 (set (mem:SI (plus:DI (mult:DI (reg:DI 102) (const_int 4 [0x4])) - (reg/f:DI 99)) [1 f S4 A32]) + (reg/f:DI 99)) [1 f[_137]+0 S4 A32]) (reg:SI 105)) "t.c":19:21 -1 (nil)) and PRE then does -PRE GCSE of j, 23 basic blocks, 3800 bytes needed, 0 substs, 0 insns creat= ed +scanning new insn with uid =3D 106. +deleting insn with uid =3D 54. +PRE: redundant insn 54 (expression 5) in bb 15, reaching reg is 107 +PRE: edge (14,15), copy expression 5 +scanning new insn with uid =3D 107. +PRE GCSE of j, 23 basic blocks, 3848 bytes needed, 1 substs, 1 insns creat= ed it looks like RTL PRE hoists (insn 54 50 55 15 (set (reg:SI 106 [ MEM[(int *)_20 + 16B] ]) (mem:SI (plus:DI (reg/f:DI 86 [ _20 ]) (const_int 16 [0x10])) [1 MEM[(int *)_20 + 16B]+0 S4 A32])) "t.c":19:21 67 {*movsi_internal} (nil)) out of the loop, across (insn 56 55 57 15 (set (mem:SI (plus:DI (mult:DI (reg:DI 102) (const_int 4 [0x4])) (symbol_ref:DI ("f") [flags 0x2] )) [1 f[_137]+0 S4 A32]) (reg:SI 105)) "t.c":19:21 67 {*movsi_internal} (expr_list:REG_DEAD (reg:SI 105) (expr_list:REG_DEAD (reg:DI 102) (expr_list:REG_DEAD (reg/f:DI 99) (nil))))) I will see why exactly.=