-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Closed
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclangClang issues not falling into any other categoryClang issues not falling into any other categoryextension:clangmiscompilationplatform:windows
Description
| Bugzilla Link | 23528 |
| Version | trunk |
| OS | Windows NT |
| Attachments | Visual Studio 2013 access violation with dissam window screenshot; |
| Reporter | LLVM Bugzilla Contributor |
Extended Description
Latest clang 3.7 for Windows (LLVM-3.7.0-r237002-win32) produce bad binary for program:
#include <stdio.h>
#define N 4
typedef double VecTy __attribute__((__vector_size__( sizeof(double) * N)));
double L[] = { 2.5, -0.1, 0.9, 5.1 };
int main(void) {
VecTy *L_vec = (VecTy*)L;
VecTy res = __builtin_shufflevector(*L_vec, *L_vec, 1, 2, 3, 0);
for (int i = 0; i < sizeof(res)/sizeof(res[0]); i++) {
printf("%f ", res[i]);
}
}Build: clang -g VecShuffle.cpp
Actual result, Windows 7 64bit (under Visual Studio):
See attached vs_access_violation.png
Actual result, Windows 7 64bit (under gdb):
>gdb a.exe
(gdb) run
Starting program: C:\workfolder\clang_tests\a.exe
[New Thread 10552.0x323c]
Program received signal SIGSEGV, Segmentation fault.
Expected result: the same on linux(redhat) -
./a.out
-0.100000 0.900000 5.100000 2.500000Note: If you move L[] inside main block, the result on windows will be correct:
C:\workfolder\clang_tests>a.exe
-0.100000 0.900000 5.100000 2.500000Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclangClang issues not falling into any other categoryClang issues not falling into any other categoryextension:clangmiscompilationplatform:windows