public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/101001] New: wrong code at -O3 on x86_64-linux-gnu
@ 2021-06-09 19:37 qrzhang at gatech dot edu
  2021-06-10  6:50 ` [Bug tree-optimization/101001] [9/10/11/12 Regression] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: qrzhang at gatech dot edu @ 2021-06-09 19:37 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101001
           Summary: wrong code at -O3 on x86_64-linux-gnu
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: qrzhang at gatech dot edu
  Target Milestone: ---

It affects gcc-8 to the trunk. Gcc-7 works fine.



$ gcc-trunk -v
gcc version 12.0.0 20210609 (experimental) [master revision
174e75a2107:3b61ba37fe1:5bfcfe3087eb05b76395c9efbfc1abbf3f9e1a03] (GCC)


$ gcc-trunk abc.c ; ./a.out
0


$ gcc-trunk -O3 abc.c ; ./a.out
Segmentation fault


$ cat abc.c
int a;
volatile char b;
int main() {
  char c;
  int d, f = 5;
  short e;
  e = 0;
  for (; e != -15; e--) {
    d = 0;
    for (; d > -16; d = d - 4) {
      f || b;
      c = 0;
      for (; c != 2; c = c - 3)
        f = 0;
    }
  }
  printf("%X\n", a);
}

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

end of thread, other threads:[~2021-11-09  7:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09 19:37 [Bug tree-optimization/101001] New: wrong code at -O3 on x86_64-linux-gnu qrzhang at gatech dot edu
2021-06-10  6:50 ` [Bug tree-optimization/101001] [9/10/11/12 Regression] " rguenth at gcc dot gnu.org
2021-06-10  7:26 ` rguenth at gcc dot gnu.org
2021-06-14  9:43 ` jakub at gcc dot gnu.org
2021-10-13 10:10 ` rguenth at gcc dot gnu.org
2021-11-09  7:57 ` 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).