public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Michael Matz <matz@suse.de>
To: Aldy Hernandez <aldyh@redhat.com>
Cc: Jeff Law <jeffreyalaw@gmail.com>, gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: Regression with recent change
Date: Tue, 14 Sep 2021 14:13:11 +0000 (UTC)	[thread overview]
Message-ID: <alpine.LSU.2.20.2109141406570.12583@wotan.suse.de> (raw)
In-Reply-To: <CAGm3qMU9uEVj=NEZ=mFVnRXbp_eNqH8Qg7mWdmbpmaWabtLpsw@mail.gmail.com>

Hello,

On Mon, 13 Sep 2021, Aldy Hernandez via Gcc-patches wrote:

The testcase still tests what it's supposed to test with ...

> > typedef unsigned short uint16_t;
> >
> > uint16_t a, b;
> >
> > int *j_global;
> > uint16_t f(void)
> > {
> >    int c, **p;
> >    short d = 2, e = 4;
> >

... "c = a;" added here (i.e. it still hangs before the pr55107 change).

> >    for (;; b++)
> >      {
> >        int *j = j_global, k = 0;
> >
> >        for (; *j; j++)
> >       {
> >         for(; c; c++)
> >           for(; k < 1; k++)
> >             {
> >               short *f = &d;
> >
> >               if(b)
> >                 return *f;
> >             }
> >       }
> >
> >        if(!c)
> >       d *= e;
> >
> >        a = d;
> >        if ((a ? b = 0 : (**p ? : 1) != (d != 1 ? 1 : (b = 0))) != ((k ? a
> : 0)
> >         < (a * (c = k))))
> >       **p = 0;
> >      }
> > }
> >
> 
> Thanks for getting rid of the noise here.
> 
> I've simplified the above to show what's going on in the warning on
> nds32-elf:
> 
> int george, *global;
> int stuff(), readme();
> 
> int
> f (void)
> {
>    int store;
> 
>    for (;;)
>      {
>        int k = 0;
> 
>        while (global)
>         {
>           for (; store; ++store)

Yeah, that seems a correct warning, your 'store' (the 'c' in the original 
testcase) is really used uninitialized (when 'global' aka '*j_global' is 
non-zero).  Sorry for not noticing earlier, I was only getting rid of 
warnings, not carefully looking at the testcase itself.  I think with 
above initialization of 'c' it's conforming, and still a correct test for 
the original bug.

> This looks like a latent bug.  For that matter, the above snippet warns 
> with -fdisable-tree-thread2, even on x86-64 (and before my patch).


Ciao,
Michael.

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

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <889cbb03-3a02-65e4-7790-c903293bacf7@gmail.com>
2021-09-13 13:29 ` Aldy Hernandez
2021-09-13 13:40   ` Jeff Law
2021-09-13 14:18     ` Michael Matz
2021-09-13 14:33       ` Jeff Law
2021-09-13 17:03       ` Aldy Hernandez
2021-09-14 14:13         ` Michael Matz [this message]
2021-09-14 14:53           ` Aldy Hernandez
2021-09-14 15:59             ` Jeff Law
2021-04-29 15:52 Jeff Law

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=alpine.LSU.2.20.2109141406570.12583@wotan.suse.de \
    --to=matz@suse.de \
    --cc=aldyh@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    /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).