From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 666DE3853823; Fri, 21 Oct 2022 16:33:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 666DE3853823 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666370038; bh=owGLBKorUP698Wtky9mc8UEenuIce50dq6a/mF2C7Ck=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Bvfif0FmYA4BQ6/oVkc7bHwlVQV16gtcEusG2K0sMjoxgo2JAIH5qQgU78it93sJl PTkh68UJ5AdVJvWzjg7WcFf/1QLcWsPzDHrDWvZf0s+UYPkA1pmoTkyncspMh8vg7l 2bGjm89Ck5c/VPK3vZvIxndB6WYHgJQPsl2Z2v0M= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/106818] riscv produces bad low_sum while doing expansion of strict aligned stores/load Date: Fri, 21 Oct 2022 16:33:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW 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: 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=3D106818 --- Comment #12 from Andrew Pinski --- MIPS also does the correct thing (it has store left/right): (insn 10 9 11 (set (reg/f:SI 196) (lo_sum:SI (reg:SI 194) (symbol_ref:SI ("array") [flags 0x40] ))) "/app/example.cpp":10:10 -1 (nil)) (insn 11 10 12 (set (mem/c:BLK (lo_sum:SI (reg:SI 194) (symbol_ref:SI ("array") [flags 0x40] )) [1 MEM[(struct sss_t *)&array].i+0 S4 A8]) (unspec:BLK [ (reg:SI 195) (mem/c:QI (lo_sum:SI (reg:SI 194) (symbol_ref:SI ("array") [flags 0x40] )) [1 MEM[(struct sss_t *)&array].i+0 S1 A8]) ] UNSPEC_STORE_LEFT)) "/app/example.cpp":10:10 -1 (nil)) (insn 12 11 0 (set (mem/c:BLK (lo_sum:SI (reg:SI 194) (symbol_ref:SI ("array") [flags 0x40] )) [1 MEM[(struct sss_t *)&array].i+0 S4 A8]) (unspec:BLK [ (reg:SI 195) (mem/c:QI (plus:SI (reg/f:SI 196) (const_int 3 [0x3])) [1 MEM[(struct sss_t *)&array]= .i+3 S1 A8]) (mem/c:BLK (lo_sum:SI (reg:SI 194) (symbol_ref:SI ("array") [flags 0x40] )) [1 MEM[(struct sss_t *)&array].i+0 S4 A8]) ] UNSPEC_STORE_RIGHT)) "/app/example.cpp":10:10 -1 (nil)) But you can see the the plus of reg196 and 3 and reg196 was set to the low_= sum and such.=