From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5C14B3858406; Fri, 2 Sep 2022 14:07:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5C14B3858406 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662127638; bh=r75p8DFBBR7drwC53XmpWPom3rXychl2zUoIj0REwpQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LShphKYv5xJik2U78duinvlDHrRRs86Emf5+YYSRupOUX/XeESTqJZQabbHurYIzD hRtOXe4CVdVK6wF6poILP0Y4CyKhPLFww6c5LBESbipEO/Un+0zZ42vrguSpzUFrMi 84j9qAP2t5ryVvQoXzJCTeROlcoNijo1//6qdmeY= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/106187] armhf: Miscompilation at O2 level (O0 / O1 are working) Date: Fri, 02 Sep 2022 14:07:18 +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.4.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rearnsha 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=3D106187 --- Comment #56 from CVS Commits --- The releases/gcc-11 branch has been updated by Richard Earnshaw : https://gcc.gnu.org/g:50982aa1145fbdb315162349833412639aa8bc4c commit r11-10232-g50982aa1145fbdb315162349833412639aa8bc4c Author: Richard Earnshaw Date: Wed Aug 3 10:01:51 2022 +0100 cselib: add function to check if SET is redundant [PR106187] A SET operation that writes memory may have the same value as an earlier store but if the alias sets of the new and earlier store do not conflict then the set is not truly redundant. This can happen, for example, if objects of different types share a stack slot. To fix this we define a new function in cselib that first checks for equality and if that is successful then finds the earlier store in the value history and checks the alias sets. The routine is used in two places elsewhere in the compiler: cfgcleanup and postreload. gcc/ChangeLog: PR rtl-optimization/106187 * alias.h (mems_same_for_tbaa_p): Declare. * alias.c (mems_same_for_tbaa_p): New function. * dse.c (record_store): Use it instead of open-coding alias check. * cselib.h (cselib_redundant_set_p): Declare. * cselib.c: Include alias.h (cselib_redundant_set_p): New function. * cfgcleanup.c: (mark_effect): Use cselib_redundant_set_p inste= ad of rtx_equal_for_cselib_p. * postreload.c (reload_cse_simplify): Use cselib_redundant_set_= p. (reload_cse_noop_set_p): Delete. (cherry picked from commit 64ce76d940501cb04d14a0d36752b4f93473531c)=