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

            Bug ID: 97555
           Summary: wrong code at -Os and above 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: su at cs dot ucdavis.edu
  Target Milestone: ---

[536] % 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 20201023 (experimental) [master revision
7991e963239:9cbfe237f74:757ba6653c2699761c2243e0194749a6695112d8] (GCC) 
[537] % 
[537] % gcctk -O1 small.c; ./a.out
[538] % 
[538] % gcctk -Os small.c
[539] % ./a.out
Floating point exception
[540] % 
[540] % cat small.c
struct {
  int a:1;
} b;

int c, d, e, f = 1, g;

int main ()
{
  for (; d < 3; d++) {
    char h = 1 % f, i = ~(0 || ~0);
    c = h;
    f = ~b.a;
    ~b.a | 1 ^ ~i && g;
    if (~e)
      i = b.a;
    b.a = i;
  }
  return 0;
}

Reply via email to