public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/98255] New: wrong code at -Os and above with -fPIC on x86_64-pc-linux-gnu
@ 2020-12-12 19:09 zhendong.su at inf dot ethz.ch
  2020-12-12 19:44 ` [Bug tree-optimization/98255] [10/11 Regression] " jakub at gcc dot gnu.org
                   ` (18 more replies)
  0 siblings, 19 replies; 20+ messages in thread
From: zhendong.su at inf dot ethz.ch @ 2020-12-12 19:09 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98255
           Summary: wrong code at -Os and above with -fPIC on
                    x86_64-pc-linux-gnu
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhendong.su at inf dot ethz.ch
  Target Milestone: ---

[510] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--prefix=/local/suz-local/software/local/gcc-trunk --enable-languages=c,c++
--disable-werror --enable-multilib --with-system-zlib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.0.0 20201212 (experimental) [master revision
ff2dfdef2f2:87144b47033:815eb852a2d293331eba2e241a986b8641d4da1f] (GCC) 
[511] % 
[511] % gcctk -Os small.c; ./a.out
[512] % 
[512] % gcctk -Os -fPIC small.c
[513] % ./a.out
Segmentation fault
[514] % 
[514] % cat small.c
struct a {
  volatile unsigned b;
  unsigned c;
};

int d, *e, h, k, l;
static struct a f;
long g;
static unsigned i = 4294967294;
volatile int j;

long m() {
  char n[4][4][3] = {{{9, 2, 8}, {9, 2, 8}, {9, 2, 8}, {9}}, {{8}}, {{8}},
{{2}}};
  while (d) {
    for (; f.c < 4; f.c++) {
      *e = 0;
      h = n[f.c + 4][0][d];
    }
    while (g)
      return n[0][3][i];
    while (1) {
      if (k) {
        j = 0;
        if (j)
          continue;
      }
      if (l)
        break;
    }
  }
  return 0;
}

int main() {
  m();
  return 0;
}

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

end of thread, other threads:[~2021-01-29 19:24 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-12 19:09 [Bug tree-optimization/98255] New: wrong code at -Os and above with -fPIC on x86_64-pc-linux-gnu zhendong.su at inf dot ethz.ch
2020-12-12 19:44 ` [Bug tree-optimization/98255] [10/11 Regression] " jakub at gcc dot gnu.org
2021-01-04 14:20 ` rguenth at gcc dot gnu.org
2021-01-21 11:56 ` jakub at gcc dot gnu.org
2021-01-21 12:28 ` jamborm at gcc dot gnu.org
2021-01-21 12:51 ` jakub at gcc dot gnu.org
2021-01-21 13:50 ` jamborm at gcc dot gnu.org
2021-01-21 13:52 ` jakub at gcc dot gnu.org
2021-01-21 13:55 ` jamborm at gcc dot gnu.org
2021-01-21 14:07 ` jakub at gcc dot gnu.org
2021-01-21 14:21 ` rguenth at gcc dot gnu.org
2021-01-21 14:22 ` jamborm at gcc dot gnu.org
2021-01-21 14:26 ` rguenth at gcc dot gnu.org
2021-01-21 14:43 ` jakub at gcc dot gnu.org
2021-01-21 16:11 ` jakub at gcc dot gnu.org
2021-01-22 10:42 ` cvs-commit at gcc dot gnu.org
2021-01-22 10:43 ` [Bug tree-optimization/98255] [10 " jakub at gcc dot gnu.org
2021-01-22 14:24 ` rguenth at gcc dot gnu.org
2021-01-29 19:19 ` cvs-commit at gcc dot gnu.org
2021-01-29 19:24 ` 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).