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

            Bug ID: 82628
           Summary: wrong code at -Os on x86_64-linux-gnu in the 32-bit
                    mode
           Product: gcc
           Version: unknown
            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: ---

This appears to be a recent regression. 

$ gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/home/su/software/tmp/gcc/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/home/su/software/tmp/gcc/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 8.0.0 20171019 (experimental) [trunk revision 253908] (GCC) 
$ 
$ gcctk -m32 -O1 small.c; ./a.out
$ gcc-7.2.0 -m32 -Os small.c; ./a.out
gcc-7.2.0: error trying to exec 'cc1': execvp: No such file or directory
$ 
$ gcctk -m32 -Os small.c
$ timeout -s 9 2 ./a.out > out
Killed
$ ls -l out
-rw------- 1 su su 86507520 Oct 19 16:15 out
$ 


--------------------------------------------------------


int printf (const char *, ...);

int a, b = 1;

int main ()
{
  while (1) 
    {
      unsigned long long d = 18446744073709551615UL; 
      while (1)
        {
          int e = b;
          while (d < 2) 
            printf ("0"); 
          if (a)
            d++;
          if (b)
            break;
        }
      break;
    }
  return 0; 
}

Reply via email to