public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/114768] Volatile reads can be optimized away Date: Sun, 21 Apr 2024 04:09:44 +0000 [thread overview] Message-ID: <bug-114768-4-LG03yEylPR@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-114768-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114768 --- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-13 branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>: https://gcc.gnu.org/g:ab3b83afc149edda11fa3c7cbb3815606731003b commit r13-8636-gab3b83afc149edda11fa3c7cbb3815606731003b Author: Jakub Jelinek <jakub@redhat.com> Date: Fri Apr 19 08:47:53 2024 +0200 rtlanal: Fix set_noop_p for volatile loads or stores [PR114768] On the following testcase, combine propagates the mem/v load into mem store with the same address and then removes it, because noop_move_p says it is a no-op move. If it was the other way around, i.e. mem/v store and mem load, or both would be mem/v, it would be kept. The problem is that rtx_equal_p never checks any kind of flags on the rtxes (and I think it would be quite dangerous to change it at this point), and set_noop_p checks side_effects_p on just one of the operands, not both. In the MEM <- MEM set, it only checks it on the destination, in store to ZERO_EXTRACT only checks it on the source. The following patch adds the missing side_effects_p checks. 2024-04-19 Jakub Jelinek <jakub@redhat.com> PR rtl-optimization/114768 * rtlanal.cc (set_noop_p): Don't return true for MEM <- MEM sets if src has side-effects or for stores into ZERO_EXTRACT if ZERO_EXTRACT operand has side-effects. * gcc.dg/pr114768.c: New test. (cherry picked from commit 9f295847a9c32081bdd0fe908ffba58e830a24fb)
next prev parent reply other threads:[~2024-04-21 4:09 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-04-18 13:19 [Bug rtl-optimization/114768] New: " bouanto at zoho dot com 2024-04-18 13:21 ` [Bug rtl-optimization/114768] " rguenth at gcc dot gnu.org 2024-04-18 13:21 ` jakub at gcc dot gnu.org 2024-04-18 13:23 ` rguenth at gcc dot gnu.org 2024-04-18 13:46 ` jakub at gcc dot gnu.org 2024-04-18 13:53 ` segher at gcc dot gnu.org 2024-04-18 13:57 ` segher at gcc dot gnu.org 2024-04-19 6:48 ` cvs-commit at gcc dot gnu.org 2024-04-19 6:49 ` jakub at gcc dot gnu.org 2024-04-19 10:38 ` cvs-commit at gcc dot gnu.org 2024-04-21 4:09 ` cvs-commit at gcc dot gnu.org [this message] 2024-04-23 6:43 ` jakub at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-114768-4-LG03yEylPR@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).