[llvm-bugs] [Bug 50944] New: wrong code at -Os and above on x86_64-linux-gnu

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jun 30 09:04:50 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=50944

            Bug ID: 50944
           Summary: wrong code at -Os and above on x86_64-linux-gnu
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Transformation Utilities
          Assignee: unassignedbugs at nondot.org
          Reporter: zhendong.su at inf.ethz.ch
                CC: llvm-bugs at lists.llvm.org

This seems to be a recent regression.

[512] % clangtk -v
clang version 13.0.0 (https://github.com/llvm/llvm-project.git
0c96a92d8666b8eb69eb1275aed572f857182d9a)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /local/suz-local/opfuzz/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
[513] % 
[513] % clangtk -O1 small.c; ./a.out
[514] % 
[514] % clangtk -Os small.c
[515] % ./a.out
Aborted
[516] % 
[516] % cat small.c
static int a, b, *c = &b, d;
int main() {
  int e;
  for (; a < 1; a++)
    if (b)
      d++;
  b = 0;
  if (!a)
    b = 0 >> e;
  c = 0;
  if (d != 0)
    __builtin_abort ();
  return 0;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210630/0ea8603d/attachment.html>


More information about the llvm-bugs mailing list