public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/99588] variable set but not used warning on static _Atomic assignment
Date: Mon, 15 Mar 2021 08:55:16 +0000	[thread overview]
Message-ID: <bug-99588-4-Aqbp4fcdaW@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-99588-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99588

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jsm28 at gcc dot gnu.org
   Last reconfirmed|                            |2021-03-15
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |diagnostic
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
We're likely confused by the "interesting" IL this emits:

;; Function test (null)
;; enabled by -tree-original


{
  static atomic int x = 0;

    static atomic int x = 0;
  printf ((const char * restrict) "%d\n", TARGET_EXPR <D.2476, 1>;
  TARGET_EXPR <D.2477, (int) __atomic_add_fetch_4 ((volatile void *) &x,
(unsigned int) TARGET_EXPR <D.2476, 1>, 5)>;, D.2477);
}

but clearly 'x' is used in the __atomic_add_fetch_4

  reply	other threads:[~2021-03-15  8:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15  1:53 [Bug c/99588] New: " godmar at gmail dot com
2021-03-15  8:55 ` rguenth at gcc dot gnu.org [this message]
2021-03-16 20:28 ` [Bug c/99588] " egallager at gcc dot gnu.org
2021-03-18 11:29 ` jakub at gcc dot gnu.org
2021-03-18 13:14 ` jakub at gcc dot gnu.org
2021-03-19 21:55 ` cvs-commit at gcc dot gnu.org
2021-03-19 21:56 ` jakub at gcc dot gnu.org
2021-03-30 22:41 ` cvs-commit at gcc dot gnu.org
2021-03-31  6:46 ` jakub at gcc dot gnu.org
2021-04-20 23:33 ` cvs-commit at gcc dot gnu.org
2021-04-22 16:51 ` cvs-commit at gcc dot gnu.org
2021-04-22 17:11 ` jakub at gcc dot gnu.org
2021-09-11 14:24 ` pinskia 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-99588-4-Aqbp4fcdaW@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).