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: [email protected]
          Reporter: [email protected]
                CC: [email protected]

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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to