[llvm-bugs] [Bug 48591] New: [11 regression] Code segfaults with -O1 -mavx2

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Dec 24 09:36:06 PST 2020


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

            Bug ID: 48591
           Summary: [11 regression] Code segfaults with -O1 -mavx2
           Product: new-bugs
           Version: 11.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: clang at evan.coeusgroup.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

I have some code which has started segfaulting (often, but not reliably) when
compiled with `clang-11 -O1 -mavx2`.  clang-10 works reliably, as do other
optimization levels.

I (well, C-Reduce) have reduced it to the following:

    typedef long a __attribute__((__vector_size__(32)));
    a d, e;
    void b(a *p1) { __builtin_memcpy(p1, &d, sizeof(d)); }
    int main() {
      {
        {
          int c[sizeof(e) / sizeof(int)];
          b(({ (a *)c; }));
        }
      }
    }

Here it is on Compiler Explorer: <https://godbolt.org/z/z8d6hK>.  The exit code
for clang-11 is 139 for me now, but I can't promise it will be for you; as I
mentioned it doesn't crash every time, and I'm pretty sure Compiler Explorer
caches results. On my desktop it's crashing on ~52% of executions.

This happens with a *lot* of the test cases in SIMDe
(<https://github.com/simd-everywhere/simde>) if anyone wants to try reproducing
with "real" code.

-- 
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/20201224/4443d334/attachment.html>


More information about the llvm-bugs mailing list