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 middle-end/102276] -ftrivial-auto-var-init fails to initialize a variable, causes a spurious warning
Date: Mon, 13 Sep 2021 10:14:52 +0000	[thread overview]
Message-ID: <bug-102276-4-osHvutEfEj@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102276-4@http.gcc.gnu.org/bugzilla/>

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
                 CC|                            |qing.zhao at oracle dot com,
                   |                            |rguenth at gcc dot gnu.org
   Last reconfirmed|                            |2021-09-13

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Both cases jump past the initialization - for C++ this would be a invalid
testcase I guess while for C we'd warn if the 'x' were initialized.

I'm not sure if it is reasonably possible to "fix" these cases.

Confirmed for the spurious warning, it is emitted by gimplification on

  switch (0) <default: <D.1982>>
  {
    int x;

    try
      {
        _1 = .DEFERRED_INIT (4, 1, 0);
        x = _1;
        __builtin_clear_padding (&x, 0B, 1);
        <D.1982>:
        D.1989 = g (&x);
        return D.1989;
      }
    finally
      {
        x = {CLOBBER};
      }
  }

  reply	other threads:[~2021-09-13 10:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-10 14:17 [Bug middle-end/102276] New: " amonakov at gcc dot gnu.org
2021-09-13 10:14 ` rguenth at gcc dot gnu.org [this message]
2021-09-13 17:50 ` [Bug middle-end/102276] " amonakov at gcc dot gnu.org
2021-09-14 17:55 ` kees at outflux dot net
2022-02-12 18:14 ` kees at outflux dot net
2022-02-12 20:22 ` pinskia at gcc dot gnu.org
2022-02-14  7:26 ` rguenth at gcc dot gnu.org
2022-02-14 16:08 ` jakub at gcc dot gnu.org
2022-02-14 17:02 ` qinzhao at gcc dot gnu.org
2022-02-14 23:21 ` qinzhao at gcc dot gnu.org
2022-02-15  8:16 ` rguenther at suse dot de
2022-02-15 16:02 ` qinzhao at gcc dot gnu.org
2022-02-15 19:55 ` qinzhao at gcc dot gnu.org
2022-02-17  7:22 ` rguenther at suse dot de
2022-02-17 19:57 ` qinzhao at gcc dot gnu.org
2022-03-02 16:55 ` cvs-commit at gcc dot gnu.org
2022-03-02 16:56 ` qinzhao 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-102276-4-osHvutEfEj@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).