GCC Bugzilla – Attachment 8402 Details for
Bug 20494
gcc -O causes segfault in code using SSE2 intrinsics
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
the code causing segfault
bug_creator.c (text/plain), 1.52 KB, created by
Isaac Elias
on 2005-03-16 13:19:13 UTC
(
hide
)
Description:
the code causing segfault
Filename:
MIME Type:
Creator:
Isaac Elias
Created:
2005-03-16 13:19:13 UTC
Size:
1.52 KB
patch
obsolete
>#include <stdio.h> >#include <emmintrin.h> > >// Compiling with the "-O" flag causes program to segfault. If it is >// compiled without "-0" it runs perfectly. >// >// gcc -v -save-temps -march=pentium4 -msse2 -I/usr/include bug_creator.c > > >//------------------------ >//Variables >__m128i A1; >__m128i B1; >__m128i BITMASK; > >__m128i A2; >__m128i B2; >//-------------------- > > >void >LEVEL_2(){ > > B1 = _mm_add_epi32(B1,A1); > A1 = _mm_add_epi32(A1,_mm_add_epi32(_mm_setzero_si128(), _mm_add_epi32(_mm_setzero_si128(),BITMASK))); > A2 = _mm_add_epi32(_mm_add_epi32(A1,A1),_mm_add_epi32(_mm_add_epi32(A1,A1),A1)); > > B2 = _mm_add_epi32(_mm_add_epi32(B1,A1),_mm_add_epi32(_mm_add_epi32(B1,A1),A1)); > > > B1 = _mm_add_epi32(B1,A1); > A1 = _mm_add_epi32(A1,_mm_add_epi32(_mm_setzero_si128(), _mm_add_epi32(_mm_setzero_si128(),BITMASK))); > > A2 = _mm_add_epi32(A2,_mm_add_epi32(_mm_add_epi32(A1,BITMASK),_mm_add_epi32(_mm_setzero_si128(),BITMASK))); > >} > >void >LEVEL_3(){ > LEVEL_2(); >} > >int >main(int argc, > char **argv){ > > > > A1 = _mm_setzero_si128(); > B1 = _mm_setzero_si128(); > A2 = _mm_setzero_si128(); > B2 = _mm_setzero_si128(); > BITMASK = _mm_setzero_si128(); > > > LEVEL_3(); > > > //Everything is initialized to zero and "_mm_add_epi32" is the only > //operation used so everything should be zero. > printf("A1: %d\n",_mm_extract_epi16(A1,0)); > printf("B1: %d\n",_mm_extract_epi16(B1,0)); > printf("A2: %d\n",_mm_extract_epi16(A2,0)); > printf("B2: %d\n",_mm_extract_epi16(A2,0)); > printf("BITMASK: %d\n",_mm_extract_epi16(BITMASK,0)); > return 1; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 20494
:
8401
| 8402