public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/106590] New: x86-64 miscompilation starting with "i386: Improve ix86_expand_int_movcc" w/ mtune=skylake
@ 2022-08-12  4:23 andres at anarazel dot de
  2022-08-12  4:23 ` [Bug target/106590] " andres at anarazel dot de
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: andres at anarazel dot de @ 2022-08-12  4:23 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106590
           Summary: x86-64 miscompilation starting with "i386: Improve
                    ix86_expand_int_movcc" w/ mtune=skylake
           Product: gcc
           Version: 12.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: andres at anarazel dot de
  Target Milestone: ---

Hi,

The attached reproducer shows a miscompilation I found building postgres. I've
bisected postgres' failure to 1ceddd7497e, but it's of course possible it's
just surfacing a prior issue.

In my reproducer, and in postgres, the problem only occurs with -mtune=skylake
or higher, but I'm not sure how related that actually is.

$ /home/andres/build/gcc-master/install/bin/gcc --version
gcc (GCC) 12.0.1 20220423 (experimental)
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ gcc-11 --version
gcc-11 (Debian 11.3.0-5) 11.3.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ /home/andres/build/gcc-master/install/bin/gcc -Wall -Wextra -O1
-mtune=skylake /tmp/test.i -o /tmp/test
$ /tmp/test
wrong results: procform->prorettype: 23, restype: 20

$ /home/andres/build/gcc-master/install/bin/gcc -Wall -Wextra -O1
-mtune=broadwell /tmp/test.i -o /tmp/test
$ /tmp/test
everything ok: procform->prorettype: 23, restype: 23

$ gcc-11 -Wall -Wextra -O1 -mtune=skylake /tmp/test.i -o /tmp/test
$ /tmp/test
everything ok: procform->prorettype: 23, restype: 23

I think it's pretty obvious that the code should never be able to result in
restype == 20.

Regards,

Andres

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-08-30  9:11 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-12  4:23 [Bug target/106590] New: x86-64 miscompilation starting with "i386: Improve ix86_expand_int_movcc" w/ mtune=skylake andres at anarazel dot de
2022-08-12  4:23 ` [Bug target/106590] " andres at anarazel dot de
2022-08-12  4:37 ` [Bug target/106590] [12/13 Regression] " pinskia at gcc dot gnu.org
2022-08-12  4:38 ` pinskia at gcc dot gnu.org
2022-08-12  4:52 ` [Bug rtl-optimization/106590] [12/13 Regression] x86-64 miscompilation starting with r12-8233-g1ceddd7497e15d " pinskia at gcc dot gnu.org
2022-08-12  4:53 ` pinskia at gcc dot gnu.org
2022-08-12  4:59 ` pinskia at gcc dot gnu.org
2022-08-12  6:40 ` rguenth at gcc dot gnu.org
2022-08-12 13:47 ` jakub at gcc dot gnu.org
2022-08-12 14:46 ` jakub at gcc dot gnu.org
2022-08-15 11:57 ` cvs-commit at gcc dot gnu.org
2022-08-15 12:00 ` jakub at gcc dot gnu.org
2022-08-29 10:05 ` cvs-commit at gcc dot gnu.org
2022-08-30  9:11 ` jakub at gcc dot gnu.org

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).