public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/101615] New: wrong code at -O3 on x86_64-linux-gnu
@ 2021-07-24 20:53 qrzhang at gatech dot edu
  2021-07-24 20:53 ` [Bug tree-optimization/101615] " qrzhang at gatech dot edu
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: qrzhang at gatech dot edu @ 2021-07-24 20:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101615
           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 appears to be a recent regression.

$ gcc-trunk -v
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20210724 (experimental) [master revision
e314cfc371d:5eb84b79079:ead235f60139edc6eb408d8d083cbb15e417b447] (GCC)

$ gcc-trunk abc.c ; ./a.out
5
7
11
3
3
3



$ gcc-trunk -O3 abc.c ; ./a.out
5
7
3
3
3
11

$ cat abc.c
int a[50] = {5, 5, 8};
short b;
int c, d;
int main() {
  int e;
  for (; b <= 4; b++)
    for (; c <= 4; c++) {
      *a |= 1;
      e = 0;
      for (; e <= 4; e++)
        a[e + 1] |= 3;
    }
  for (; d < 6; d++)
    printf("%d\n", a[d]);
}

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

end of thread, other threads:[~2022-01-13 10:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-24 20:53 [Bug tree-optimization/101615] New: wrong code at -O3 on x86_64-linux-gnu qrzhang at gatech dot edu
2021-07-24 20:53 ` [Bug tree-optimization/101615] " qrzhang at gatech dot edu
2021-07-24 20:59 ` [Bug tree-optimization/101615] [12 Regression] wrong code at -O3 on x86_64-linux-gnu since r12-1872 pinskia at gcc dot gnu.org
2021-07-27 10:48 ` rguenth at gcc dot gnu.org
2021-07-28 13:14 ` cvs-commit at gcc dot gnu.org
2021-07-28 13:15 ` rguenth at gcc dot gnu.org
2021-07-28 15:41 ` cvs-commit at gcc dot gnu.org
2021-07-28 15:41 ` rguenth at gcc dot gnu.org
2022-01-13 10:54 ` cvs-commit 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).