Skip to content

Instantly share code, notes, and snippets.

@kaityo256
Created May 25, 2017 09:50
Show Gist options
  • Save kaityo256/0878155c2b1e183ecdd3fa103146f794 to your computer and use it in GitHub Desktop.
Save kaityo256/0878155c2b1e183ecdd3fa103146f794 to your computer and use it in GitHub Desktop.
An example code causing an internal error
#include <stdio.h>
typedef double v4df __attribute__((vector_size(32)));
typedef double v8df __attribute__((vector_size(64)));
template <class T>
void func(T r) {
double *a = (double*)(&r);
for(int i=0;i < sizeof(T)/sizeof(double);i++){
printf("%.10f ",a[i]);
}
printf("\n");
}
int
main(void){
v4df v4z;
v8df v8z;
func(v4z);
func(v8z);
}
@kaityo256
Copy link
Author

Try following options.

$ icpc -O1 test.cpp
$ icpc -O2 test.cpp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment