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 target/107131] [11/12 Regression] wrong code with -Os -fno-ipa-vrp -fno-tree-bit-ccp
Date: Thu, 27 Apr 2023 12:02:46 +0000	[thread overview]
Message-ID: <bug-107131-4-uD9fokdGta@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107131-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #8)
> I think the problem happens during combine.  Parts of the vector code
> related to:
>   V b = (V) { } >= o;
>   V c = b <= (V)(b >= (V) { 0, 0, 0, 0, 0, 0x90DF0BE3990AC871ULL });
> - in particular the scalar c[5] computation, i.e.
> unsigned long long b = 0 >= o ? -1ULL : 0ULL;
> unsigned long long c = b <= (b >= 0x90DF0BE3990AC871ULL ? -1ULL : 0ULL) ?
> -1ULL : 0ULL;
> evaluates to 0 rather than -1 that it should when o is 0.
> 
> This boils down to:
> __attribute__((noipa)) unsigned long long
> foo (unsigned char o)
> {
>   unsigned long long t1 = -(long long) (o == 0);
>   unsigned long long t2 = -(long long) (t1 > 10439075533421201520ULL);
>   unsigned long long t3 = -(long long) (t1 <= t2);
>   return t3;
> }
> 
> int
> main ()
> {
>   if (foo (0) != -1ULL)
>     __builtin_abort ();
>   return 0;
> }
> at -O2 or -Os, which was miscompiled starting with r12-303-g86403f4e6e5f7216
> and got fixed with r13-3530-g0e36a9c6915c713d30.
> No idea why this is marked as 11 regression though...
> 
> So, do we need to backport PR107172 change to 12 branch?

Yes.  Testing that now.

  parent reply	other threads:[~2023-04-27 12:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-03 13:37 [Bug target/107131] New: " zsojka at seznam dot cz
2022-10-03 14:48 ` [Bug target/107131] [11/12 Regression] " marxin at gcc dot gnu.org
2022-10-03 19:34 ` pinskia at gcc dot gnu.org
2022-10-03 19:40 ` pinskia at gcc dot gnu.org
2022-10-06  7:12 ` [Bug target/107131] [11/12/13 " rguenth at gcc dot gnu.org
2022-10-18  8:38 ` rguenth at gcc dot gnu.org
2022-11-18 12:52 ` jakub at gcc dot gnu.org
2023-01-13 10:15 ` cvs-commit at gcc dot gnu.org
2023-01-13 14:01 ` jakub at gcc dot gnu.org
2023-01-13 16:27 ` jakub at gcc dot gnu.org
2023-01-13 16:39 ` cvs-commit at gcc dot gnu.org
2023-01-13 16:42 ` [Bug target/107131] [11/12 " jakub at gcc dot gnu.org
2023-04-27 12:02 ` rguenth at gcc dot gnu.org [this message]
2023-04-27 12:03 ` rguenth at gcc dot gnu.org
2023-05-29 10:07 ` jakub 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-107131-4-uD9fokdGta@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).