public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: Aldy Hernandez <aldyh@redhat.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>,
	Richard Biener <richard.guenther@gmail.com>
Subject: Re: Regression with recent change
Date: Mon, 13 Sep 2021 07:40:31 -0600	[thread overview]
Message-ID: <3af2aac4-1b26-ff97-b73a-fa7c086b8dd6@gmail.com> (raw)
In-Reply-To: <CAGm3qMUNRK21=DgcrvCidOJk2FuhkDs_hGbwF_5FoEUenh0Q5w@mail.gmail.com>



On 9/13/2021 7:29 AM, Aldy Hernandez wrote:
> Jeff has pointed out that after my change adding global ranges to the
> path solver, torture/pr55107.c is failing.  Before I start digging
> deep into the IL, I'd like to make sure this is not either expected or
> a bogus test.
>
> Compiling this test on x86 with -Wall yields:
>
> $ gcc -c -O2 pr55107.c -Wall
> pr55107.c: In function ‘f’:
> pr55107.c:32:51: warning: the omitted middle operand in ‘?:’ will
> always be ‘true’, suggest explicit middle operand [-Wparentheses]
>     32 |       ((a = d) ? b = 0 : (**p ? : 1) != (d != 1 ? : (a = 0)))
> != (k ? a : 0)
>        |                                                   ^
> pr55107.c:33:11: warning: suggest parentheses around comparison in
> operand of ‘!=’ [-Wparentheses]
>     32 |       ((a = d) ? b = 0 : (**p ? : 1) != (d != 1 ? : (a = 0)))
> != (k ? a : 0)
>        |
>    ~~~~~~~~~~~
>     33 |           < (a *= c = k) && (**p = 0);
>        |           ^~~~~~~~~~~~~~
> pr55107.c:33:16: warning: operation on ‘a’ may be undefined [-Wsequence-point]
>     33 |           < (a *= c = k) && (**p = 0);
>        |                ^~
> pr55107.c:33:16: warning: operation on ‘a’ may be undefined [-Wsequence-point]
> pr55107.c:33:26: warning: value computed is not used [-Wunused-value]
>     33 |           < (a *= c = k) && (**p = 0);
>        |                          ^~
> pr55107.c:17:14: warning: ‘j’ is used uninitialized [-Wuninitialized]
>     17 |       for (; *j; j++)
>        |              ^~
>
> So it looks like there's some undefined behavior going on, even before
> my patch.  I'd like to get some feedback, because this is usually the
> type of problems I see in the presence of a smarter threader... things
> get shuffled around, problematic code gets isolated, and warning
> passes have an easier time (or sometimes harder time) diagnosing
> things.
The original issue was PRE hanging, so I'd lean towards keeping the test 
as-is and instead twiddling any warning flags we can to make the 
diagnostics go away.

jeff

  reply	other threads:[~2021-09-13 13:40 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 [this message]
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
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=3af2aac4-1b26-ff97-b73a-fa7c086b8dd6@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=aldyh@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@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).