[llvm-bugs] [Bug 50649] New: LLVM ERROR: out of memory on a missing union variable

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jun 9 16:35:51 PDT 2021


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

            Bug ID: 50649
           Summary: LLVM ERROR: out of memory on a missing union variable
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: k.even-mendoza at imperial.ac.uk
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

Created attachment 24935
  --> https://bugs.llvm.org/attachment.cgi?id=24935&action=edit
trace of the crash in Clang-12

The following code crashed the compiler:
```
union U0 {
    const volatile int f0;
};
static unsigned short g_54 = 0x8C83L;
static volatile unsigned short g_139 = 0x707CL;
static const volatile union U0 g_539 = {0x6A7978CCL};
int main (int argc, char* argv[]) {
     unsigned short *a = &g_54;
     unsigned short *l_639 = &g_54;
     (*a) = ((*l_639) |= f(p_39.f0, p_39.f0));
    return 0;
}
```
with Clang-13, Clang-12, Clang-11 and Clang-10, and with the following error:
LLVM ERROR: out of memory
Allocation failed
...
clang-13: error: unable to execute command: Aborted (core dumped)
clang-13: error: clang frontend command failed due to signal (use -v to see
invocation).

I attached the full trace as a file. 

I ran it with -O0: clang -O0 test2.c (Ubuntu-18 64x, 32GB RAM and 4 CPUs)

It doesn't crash with GCC and ends in few seconds.

-- 
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/20210609/b0f1e0a9/attachment.html>


More information about the llvm-bugs mailing list