public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/101105] New: wrong code at -O3 on x86_64-linux-gnu
@ 2021-06-17  3:44 qrzhang at gatech dot edu
  2021-06-17  3:46 ` [Bug tree-optimization/101105] " qrzhang at gatech dot edu
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: qrzhang at gatech dot edu @ 2021-06-17  3:44 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101105
           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 regression in 11.

$ gcc-trunk -v
Configured with: ../gcc/configure --prefix=/nethome/qzhang414/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20210616 (experimental) [master revision
041f7417707:a530c589490:3155d51bfd1de8b6c4645dcb2292248a8d7cc3c9] (GCC)



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

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


$ cat abc.c
short a;
int b[5][4] = {2, 2};
long *c;
int d;
short(e)(f) { return f == 0 || a && f == 1 ? 0 : a; }
int main() {
  int g, h;
  g = 3;
  for (; g >= 0; g--) {
    h = 3;
    for (; h >= 0; h--)
      b[g][h] = b[0][1] && e(1);
  }
  d = b[0][1];
  if (d)
    *c = 4073709551611;
  printf("%d\n", 2);
}

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

end of thread, other threads:[~2021-10-13 10:11 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-17  3:44 [Bug tree-optimization/101105] New: wrong code at -O3 on x86_64-linux-gnu qrzhang at gatech dot edu
2021-06-17  3:46 ` [Bug tree-optimization/101105] " qrzhang at gatech dot edu
2021-06-17  4:40 ` [Bug tree-optimization/101105] [11/12 Regression] " pinskia at gcc dot gnu.org
2021-06-17  7:06 ` rguenth at gcc dot gnu.org
2021-06-23  9:37 ` rguenth at gcc dot gnu.org
2021-06-23  9:45 ` rsandifo at gcc dot gnu.org
2021-06-23  9:52 ` rguenth at gcc dot gnu.org
2021-06-24  7:07 ` cvs-commit at gcc dot gnu.org
2021-06-24  7:09 ` [Bug tree-optimization/101105] [11 " rguenth at gcc dot gnu.org
2021-06-24  7:15 ` rguenth at gcc dot gnu.org
2021-06-25  9:06 ` cvs-commit at gcc dot gnu.org
2021-06-25  9:06 ` [Bug tree-optimization/101105] [9/10 " rguenth at gcc dot gnu.org
2021-09-06 10:18 ` cvs-commit at gcc dot gnu.org
2021-10-13 10:09 ` [Bug tree-optimization/101105] [9 " cvs-commit at gcc dot gnu.org
2021-10-13 10:11 ` rguenth 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).