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

            Bug ID: 39849
           Summary: Clang crashes when using C90 __restrict keyword
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangb...@nondot.org
          Reporter: gui...@berkeley.edu
                CC: blitzrak...@gmail.com, dgre...@apple.com,
                    erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
                    richard-l...@metafoo.co.uk

Created attachment 21181
  --> https://bugs.llvm.org/attachment.cgi?id=21181&action=edit
Source and preprocessed files for the two cases, triggering different crashes.
[Note: Decompresses to current directory]

https://godbolt.org/z/j_WU8P

Minimal code is:
#include <immintrin.h>
struct S  {  __m128 operator + (const __m128 r) const { return r+l; } };
struct A
{
  S s;
  __m128 v;
  void f(A& /*__restrict*/ a) __restrict __attribute__((used)) { v += s+a.v; }
};
int main() { return 0; }

Reporting two different crashes (files t1.cpp, t2.cpp attached). 
Commenting in/out the first '__restrict' does not affect the result. 
It's the second '__restrict' (the one affecting 'this') that triggers the bug.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to