[llvm-bugs] [Bug 47458] New: clang++ hangs when optimizing the infinite loop

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 8 02:59:53 PDT 2020


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

            Bug ID: 47458
           Summary: clang++ hangs when optimizing the infinite loop
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: tangyixuan at mail.dlut.edu.cn
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Hi, the following code causes clang++ hangs with -O2/O3/Os.

$ cat s.cpp

struct A {
        float a;
        A ( float b ){
                for ( int c ; c < b ;)
                        ++ a ;
        }
};
struct B {
        B ( A );
};
int main (){
        A (1.0);
        B d (0.0), e (1.0);
}

$ clang++ -O2 s.cpp
<hang>

$ clang -v
clang version 11.0.0 (https://github.com/llvm/llvm-project.git
ab4627364aefcaac751e757b721b7d07b48a545a)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/oscar/compiler/llvm-project/build/bin

-- 
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/20200908/c9e061d3/attachment.html>


More information about the llvm-bugs mailing list