From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8A724385DC26; Thu, 30 Apr 2020 15:00:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8A724385DC26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1588258858; bh=d0rmesGzQhAF3GNj78ADSsY624e0cZGXk5gQFfGmXFk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=GqO1/906Z8fUmArHUpdoRDIogKOTjabKUtkgroRSYM0FMB/aQbFnlu0yJXHnBL4Gj HOB54AnrXZDWeeLeowHXddPkAKJnVXvGBvTSrcO3ic1uyWYPGvTks0+0n9TSqZ+f+k 0IbkCZ7RY+dhe+VHCH6YS0fFvAQ6dFGBXDLo3jlw= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/94873] [8/9/10 Regression] wrong code with -O -fno-merge-constants -fno-split-wide-types -fno-tree-fre Date: Thu, 30 Apr 2020 15:00:58 +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: 10.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: 8.5 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, 30 Apr 2020 15:00:58 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94873 --- Comment #3 from Jakub Jelinek --- I think this goes wrong during combine, auto-inc-dec makes (insn 29 6 7 2 (set (reg/f:DI 106) (reg/f:DI 97)) "pr94873.c":11:48 -1 (expr_list:REG_DEAD (reg/f:DI 97) (nil))) (insn 7 29 8 2 (set (reg:TI 95 [ D.3590 ]) (mem/u/c:TI (post_inc:DI (reg/f:DI 106)) [0 S16 A128])) "pr94873.c":11:48 58 {*movti_aarch64} (expr_list:REG_INC (reg/f:DI 106) (expr_list:REG_EQUAL (const_wide_int 0x0f4409395252b9560) (nil)))) ... (insn 19 18 20 2 (set (reg:DI 0 x0) (reg/f:DI 106)) "pr94873.c":13:5 53 {*movdi_aarch64} (expr_list:REG_DEAD (reg/f:DI 106) (expr_list:REG_EQUAL (const:DI (plus:DI (symbol_ref:DI ("*.LANCHOR0= ") [flags 0x182]) (const_int 16 [0x10]))) (nil)))) where pseudo 97 holds .LANCHOR0 address, at which there is the 16-byte cons= tant followed by the string literal. But combine optimizes that REG_INC insn away and we end up with (insn 19 18 20 2 (set (reg:DI 0 x0) (lo_sum:DI (reg/f:DI 98) (symbol_ref:DI ("*.LANCHOR0") [flags 0x182]))) "pr94873.c":13:5 1054 {add_losym_di} (expr_list:REG_DEAD (reg/f:DI 98) (expr_list:REG_EQUAL (const:DI (plus:DI (symbol_ref:DI ("*.LANCHOR0= ") [flags 0x182]) (const_int 16 [0x10]))) (nil)))) as you can see, the actual value in the insn isn't equal to what REG_EQUAL = note says.=