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/106155] [12/13 Regression] spurious "may be used uninitialized" warning
Date: Tue, 06 Sep 2022 13:17:07 +0000	[thread overview]
Message-ID: <bug-106155-4-pzZSTb14FG@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-106155-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
The following variant warns with all GCC releases I tested (and -fno-ivopts
fixes it), not exposing a mitigating jump threading opportunity:

int *e;
int f1 (void);
void f2 (int);
long f3 (void *, long, int *);
void f4 (void *);
int *fh;

void tst (void)
{
  int status;
  unsigned char badData[5][5] = { { 7 }, { 16 }, { 23 } };
  int badDataSize[5] = { 1, 1, 1 };
  int i;

  for (i = 0; i < 5; i++)
    {
      int emax;
      if (i == 2)
        emax = f1 ();
      status = f3 (&badData[i][0], badDataSize[i], fh);
      if (status)
        {
          f1 ();
          f1 ();
          f1 ();
        }
      f4 (fh);
      *e = 0;
      f1 ();
      if (i >= 2)
        f2 (emax);
    }
}

  parent reply	other threads:[~2022-09-06 13:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-01  1:49 [Bug tree-optimization/106155] New: " vincent-gcc at vinc17 dot net
2022-07-01  2:05 ` [Bug tree-optimization/106155] " vincent-gcc at vinc17 dot net
2022-07-01  2:32 ` pinskia at gcc dot gnu.org
2022-07-01  2:43 ` pinskia at gcc dot gnu.org
2022-07-04 12:09 ` marxin at gcc dot gnu.org
2022-07-25 15:27 ` rguenth at gcc dot gnu.org
2022-08-31 14:04 ` rguenth at gcc dot gnu.org
2022-09-06 12:57 ` rguenth at gcc dot gnu.org
2022-09-06 13:17 ` rguenth at gcc dot gnu.org [this message]
2022-09-06 13:21 ` rguenth at gcc dot gnu.org
2022-10-17 12:30 ` rguenth at gcc dot gnu.org
2022-11-23 16:44 ` vincent-gcc at vinc17 dot net
2023-05-08 12:24 ` [Bug tree-optimization/106155] [12/13/14 " rguenth at gcc dot gnu.org
2023-06-13  2:03 ` vincent-gcc at vinc17 dot net

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-106155-4-pzZSTb14FG@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).