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 tree-optimization/111240] [12/13/14 Regression] Incorrect warning from -Wmaybe-uninitialized
Date: Thu, 31 Aug 2023 09:46:44 +0000	[thread overview]
Message-ID: <bug-111240-4-1ZdwaWBJ1K@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-111240-4@http.gcc.gnu.org/bugzilla/>

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |11.4.0
             Status|UNCONFIRMED                 |NEW
            Summary|Incorrect warning from      |[12/13/14 Regression]
                   |-Wmaybe-uninitialized       |Incorrect warning from
                   |                            |-Wmaybe-uninitialized
   Last reconfirmed|2023-08-30 00:00:00         |2023-08-31
   Target Milestone|---                         |12.4
      Known to fail|                            |12.1.0, 12.2.0, 13.2.0,
                   |                            |14.0
           Keywords|                            |needs-reduction
     Ever confirmed|0                           |1

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.

rettype_58 = enforce_generic_type_consistency (&actual_arg_types,
&declared_arg_types, 0, _56, 0);

and we reach this on the args == 0 path where indeed actual_arg_types
is uninitialized and our heuristic says that a const qualified pointer
is an input and thus might be read.  So you get a maybe-uninitialized
diagnostic at the call.

GCC doesn't know that the 'nargs' argument relates to the array and
that at most 'nargs' (zero here) arguments are inspected.

So I think it works as designed, we have some duplicate bugreports
complaining about this "heuristic".

We are exposing this to ourselves by optimizing the args == 0 case
(skipping the initialization loop and constant propagating the
nargs argument).  Aka jump-threading.

  parent reply	other threads:[~2023-08-31  9:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-30 15:16 [Bug c/111240] New: " bruce at momjian dot us
2023-08-30 15:25 ` [Bug tree-optimization/111240] " pinskia at gcc dot gnu.org
2023-08-30 15:27 ` pinskia at gcc dot gnu.org
2023-08-30 15:30 ` bruce at momjian dot us
2023-08-30 15:30 ` bruce at momjian dot us
2023-08-30 15:38 ` pinskia at gcc dot gnu.org
2023-08-31  9:46 ` rguenth at gcc dot gnu.org [this message]
2024-03-07 23:22 ` [Bug tree-optimization/111240] [12/13/14 Regression] " law 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-111240-4-1ZdwaWBJ1K@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).