[llvm-bugs] [Bug 49716] New: clang segfault at -O2 in C mode, reduced test case included

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 24 14:45:23 PDT 2021


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

            Bug ID: 49716
           Summary: clang segfault at -O2 in C mode, reduced test case
                    included
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Windows NT
            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

Created attachment 24690
  --> https://bugs.llvm.org/attachment.cgi?id=24690&action=edit
Non-reduced, un-preprocessed source

Here is a reduced test case:


#include <stdlib.h>
typedef union {
  int16_t i16 __attribute__((__vector_size__(32)));
  int32_t i32 __attribute__((__vector_size__(32)));
} simde__m256i_private;
simde__m256i_private simde__m256i_to_private();
int simde_mm256_madd_epi16() {
  simde__m256i_private r_, a_ = simde__m256i_to_private(),
                           b_ = simde__m256i_to_private();
  for (size_t i = 0; i < sizeof sizeof(r_); i += 2)
    r_.i32[i] = a_.i16[i] * b_.i16[i] + a_.i16[i + 1] * b_.i16[i + 1];
  simde__m256i_from_private(r_);
}


Compile with -O2 using clang (clang++ works) on x86_64.  Godbolt link:
https://godbolt.org/z/71o5hdY4h

The problem only manifests in my codebase with clang 12, but this test case
seems to reliably reproduce the issue in earlier versions as well (back to 7 on
godbolt).

I'm also attaching the original (non-reduced) source.  Please let me know if
you need any additional information.

-- 
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/20210324/c3ba48d9/attachment-0001.html>


More information about the llvm-bugs mailing list