[llvm-bugs] [Bug 49052] New: Clang crashed when compiling target code with assert(0)

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Feb 4 19:26:47 PST 2021


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

            Bug ID: 49052
           Summary: Clang crashed when compiling target code with
                    assert(0)
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Clang Compiler Support
          Assignee: unassignedclangbugs at nondot.org
          Reporter: tianshilei1992 at gmail.com
                CC: llvm-bugs at lists.llvm.org

Clang crashed when compiling the following simple case:
```
#include <assert.h>

int main(int argc, char *argv[]) {
#pragma omp target
  { assert(0); }
  return 0;
}
```
The crash is because of broken IR in kernel function because code after
`assert(0)` is unreachable, therefore the BB afterwards might be removed,
leaving a bad reference.
```
6: ; preds = %0
  call void @__omp_offloading_10301_fba7c_main_l4_worker() #5, !dbg !18
  br label <badref>, !dbg !17
```

-- 
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/20210205/3e07c025/attachment.html>


More information about the llvm-bugs mailing list