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

            Bug ID: 46712
           Summary: Clang hang on in valid code under -O1 ~ -Os at compile
                    time
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: haoxi...@gmail.com
                CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org,
                    neeil...@live.com, richard-l...@metafoo.co.uk

Hi, all.

This code, test.cc, is a valid code, but makes Clang hung on at compile time.

$cat test.cc
int a, b, c;
long d;
void e() {
  long f(0 >= 0 <= ~(b && a));
  c = a && (f || !d) && !0;
}

$time clang++-trunk -c -w -O0 test.cc

real    0m0.020s
user    0m0.012s
sys     0m0.008s


$time clang++-trunk -c -w -O1 test.cc
//endless compiling

Interestingly, Clang-10 works fine with this case. So, I guess this is a
regression issue in Clang-trunk.

$time clang++-10 -c -w test.cc

real    0m0.023s
user    0m0.014s
sys     0m0.009s

$clang++ -v
clang version 11.0.0 (https://github.com/llvm/llvm-project.git
305b500eaf8c3b6a319e4571b4279a4694645d0d)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/tuhaoxin/compilers/llvm-project/build/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
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/10
Candidate multilib: .;@m64
Selected multilib: .;@m64


Thanks
Haoxin

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to