public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/103905] New: [12 Regression] Miscompiled i386-expand.c with -march=bdver1 and -O3 since r12-1789-g836328b2c99f5b8d
@ 2022-01-04 19:29 marxin at gcc dot gnu.org
  2022-01-04 19:30 ` [Bug target/103905] " pinskia at gcc dot gnu.org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-01-04 19:29 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103905
           Summary: [12 Regression] Miscompiled i386-expand.c with
                    -march=bdver1 and -O3 since r12-1789-g836328b2c99f5b8d
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: rguenth at gcc dot gnu.org, uros at gcc dot gnu.org
  Target Milestone: ---

Created attachment 52119
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52119&action=edit
test-case

It's follow up of what I started tracking in PR92860.

$ g++ /tmp/i386-expand.ii -march=bdver1 -O3 -c -Wno-narrowing

is miscompiled so that the following test-case crashes when run with the
miscompiled compiler:

$ $ cat options-save2.ii
char flags[16];

int one = 1, two = 2;

void
__attribute__ ((noipa))
save() {
  flags[0] = one;
  flags[1] = one;
  flags[2] = one;
  flags[3] = one;
  flags[4] = one;
  flags[5] = one;
  flags[6] = one;
  flags[7] = one;
  flags[8] = one;
  flags[9] = one;
  flags[10] = one;
  flags[11] = one;
  flags[12] = one;
  flags[13] = one;
  flags[14] = one;
  flags[15] = two;
}

int
main()
{
  save ();

  __builtin_printf ("flags[0]=%d, flags[15]=%d\n", flags[0], flags[15]);
  if (flags[15] != 2)
    __builtin_abort ();

  return 0;
}

One needs here -O2 -march=core2.

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

end of thread, other threads:[~2022-01-06 21:26 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-04 19:29 [Bug target/103905] New: [12 Regression] Miscompiled i386-expand.c with -march=bdver1 and -O3 since r12-1789-g836328b2c99f5b8d marxin at gcc dot gnu.org
2022-01-04 19:30 ` [Bug target/103905] " pinskia at gcc dot gnu.org
2022-01-04 19:56 ` marxin at gcc dot gnu.org
2022-01-04 20:12 ` ubizjak at gmail dot com
2022-01-04 21:03 ` ubizjak at gmail dot com
2022-01-04 21:14 ` ubizjak at gmail dot com
2022-01-04 21:31 ` jakub at gcc dot gnu.org
2022-01-04 21:44 ` ubizjak at gmail dot com
2022-01-05  5:43 ` marxin at gcc dot gnu.org
2022-01-05  7:48 ` rguenth at gcc dot gnu.org
2022-01-05  8:57 ` ubizjak at gmail dot com
2022-01-05  9:02 ` marxin at gcc dot gnu.org
2022-01-05  9:17 ` jakub at gcc dot gnu.org
2022-01-05  9:29 ` ubizjak at gmail dot com
2022-01-05 10:01 ` marxin at gcc dot gnu.org
2022-01-05 19:07 ` cvs-commit at gcc dot gnu.org
2022-01-05 19:14 ` ubizjak at gmail dot com
2022-01-06 21:26 ` pinskia 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).