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: Fri, 19 Apr 2024 10:38:04 +0000	[thread overview]
Message-ID: <bug-114768-4-1iMdi8LxYP@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 #9 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Thomas Schwinge <tschwinge@gcc.gnu.org>:

https://gcc.gnu.org/g:9451b6c0a941dc44ca6f14ff8565d74fe56cca59

commit r14-10039-g9451b6c0a941dc44ca6f14ff8565d74fe56cca59
Author: Thomas Schwinge <tschwinge@baylibre.com>
Date:   Fri Apr 19 12:32:03 2024 +0200

    Enable 'gcc.dg/pr114768.c' for nvptx target [PR114768]

    Follow-up to commit 9f295847a9c32081bdd0fe908ffba58e830a24fb
    "rtlanal: Fix set_noop_p for volatile loads or stores [PR114768]": nvptx
does
    behave in the exactly same way as expected; see 'diff' of before vs. after
the
    'gcc/rtlanal.cc' code changes:

        PASS: gcc.dg/pr114768.c (test for excess errors)
        [-FAIL:-]{+PASS:+} gcc.dg/pr114768.c scan-rtl-dump final "\\(mem/v:"

        --- 0/pr114768.c.347r.final 2024-04-19 11:34:34.577037596 +0200
        +++ ./pr114768.c.347r.final 2024-04-19 12:08:00.118312524 +0200
        @@ -13,15 +13,27 @@
         ;;  entry block defs        1 [%stack] 2 [%frame] 3 [%args]
         ;;  exit block uses         1 [%stack] 2 [%frame]
         ;;  regs ever live
        -;;  ref usage      r1={1d,2u} r2={1d,2u} r3={1d,1u}
        -;;    total ref usage 8{3d,5u,0e} in 1{1 regular + 0 call} insns.
        +;;  ref usage      r1={1d,3u} r2={1d,3u} r3={1d,2u} r22={1d,1u}
r23={1d,2u}
        +;;    total ref usage 16{5d,11u,0e} in 4{4 regular + 0 call} insns.
         (note 1 0 4 NOTE_INSN_DELETED)
         (note 4 1 2 2 [bb 2] NOTE_INSN_BASIC_BLOCK)
        -(note 2 4 3 2 NOTE_INSN_DELETED)
        +(insn 2 4 3 2 (set (reg/v/f:DI 23 [ p ])
        +        (unspec:DI [
        +                (const_int 0 [0])
        +            ] UNSPEC_ARG_REG))
"source-gcc/gcc/testsuite/gcc.dg/pr114768.c":8:1 14 {load_arg_regdi}
        +     (nil))
         (note 3 2 6 2 NOTE_INSN_FUNCTION_BEG)
        -(note 6 3 10 2 NOTE_INSN_DELETED)
        -(note 10 6 11 2 NOTE_INSN_EPILOGUE_BEG)
        -(jump_insn 11 10 12 2 (return)
"source-gcc/gcc/testsuite/gcc.dg/pr114768.c":10:1 289 {return}
        +(insn 6 3 7 2 (set (reg:SI 22 [ _1 ])
        +        (mem/v:SI (reg/v/f:DI 23 [ p ]) [1 MEM[(volatile int
*)p_3(D)]+0 S4 A32])) "source-gcc/gcc/testsuite/gcc.dg/pr114768.c":9:8 6
{*movsi_insn}
        +     (nil))
        +(insn 7 6 10 2 (set (mem:SI (reg/v/f:DI 23 [ p ]) [1 *p_3(D)+0 S4
A32])
        +        (reg:SI 22 [ _1 ]))
"source-gcc/gcc/testsuite/gcc.dg/pr114768.c":9:6 6 {*movsi_insn}
        +     (expr_list:REG_DEAD (reg/v/f:DI 23 [ p ])
        +        (expr_list:REG_DEAD (reg:SI 22 [ _1 ])
        +            (nil))))
        +(note 10 7 13 2 NOTE_INSN_EPILOGUE_BEG)
        +(note 13 10 11 3 [bb 3] NOTE_INSN_BASIC_BLOCK)
        +(jump_insn 11 13 12 3 (return)
"source-gcc/gcc/testsuite/gcc.dg/pr114768.c":10:1 289 {return}
              (nil)
          -> return)
         (barrier 12 11 0)

        --- 0/pr114768.s    2024-04-19 11:34:34.577037596 +0200
        +++ ./pr114768.s    2024-04-19 12:08:00.118312524 +0200
        @@ -13,5 +13,10 @@
         {
            .reg.u64 %ar0;
            ld.param.u64 %ar0, [%in_ar0];
        +   .reg.u32 %r22;
        +   .reg.u64 %r23;
        +           mov.u64 %r23, %ar0;
        +           ld.u32  %r22, [%r23];
        +           st.u32  [%r23], %r22;
            ret;
         }

            PR testsuite/114768
            gcc/testsuite/
            * gcc.dg/pr114768.c: Enable for nvptx target.

  parent reply	other threads:[~2024-04-19 10:38 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 [this message]
2024-04-21  4:09 ` cvs-commit at gcc dot gnu.org
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-1iMdi8LxYP@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: link
Be 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).