From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6D4893858D32; Wed, 10 Apr 2024 07:43:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6D4893858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712735012; bh=m/YO30JhvAlE2dbw6BaJfQHJq90ZIp3yS5MybCIDKVs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=i3d1V1YQOincq4TRbRRJ6m+9HQuBEDd/51g5BUEnUFcP1G+++igMmO4bOZ6ewkWmJ oQcmGU0KsSpfjQ/dxfcknLMDVERNHs24ejI7UvJ4sOOlQnfe8kSQQjsCcitxBPtMBm LZTqx9sClv0KYHIS4aAHMpPYqLCv/acVt57Y0wZE= From: "dizhao at os dot amperecomputing.com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/114674] [aarch64] ldp_fusion fails to merge 2 strs due to imprecise alignment info Date: Wed, 10 Apr 2024 07:43:32 +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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dizhao at os dot amperecomputing.com X-Bugzilla-Status: UNCONFIRMED 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=3D114674 --- Comment #1 from Di Zhao --- Here's a quick fix I tried, that works on the small test case above: diff --git a/gcc/config/aarch64/aarch64-ldp-fusion.cc b/gcc/config/aarch64/aarch64-ldp-fusion.cc index 365dcf48b22..43478ede72b 100644 --- a/gcc/config/aarch64/aarch64-ldp-fusion.cc +++ b/gcc/config/aarch64/aarch64-ldp-fusion.cc @@ -1735,6 +1735,9 @@ ldp_bb_info::fuse_pair (bool load_p, rtx new_mem =3D adjust_address_nv (effective_base, mode_for_mem, adjust_amt); + // Keep original alignment info for ldp/stp policy. + set_mem_align (new_mem, MEM_ALIGN (change_mem)); + rtx new_set =3D load_p ? gen_rtx_SET (change_reg, new_mem) : gen_rtx_SET (new_mem, change_reg); Is is OK?=