Bug 233485 - __builtin_ia32_psllw128 causes internal compiler error
__builtin_ia32_psllw128 causes internal compiler error
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
6
x86_64 Linux
medium Severity urgent
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-03-22 14:34 EDT by Ali Erol
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-03-24 05:25:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Preprocessed source stored for the sample code provided in the report (107.35 KB, application/octet-stream)
2007-03-22 14:39 EDT, Ali Erol
no flags Details

  None (edit)
Description Ali Erol 2007-03-22 14:34:22 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.1) Gecko/20061208 Firefox/2.0.0.1

Description of problem:
The simplified code below and any other code containing built-in SSE shift instructions can not be compiled because of an internal compiler error. 

#include <xmmintrin.h>

main() {
  __v8hi x;
  __v8hi y = __builtin_ia32_psllw128(x, (__v2di){0LL, 1LL});
}

I get the following error message:

zain.C: In function ‘int main()’:
zain.C:5: internal compiler error: in ix86_expand_builtin, at config/i386/i386.c:16322
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccEdZBso.out file, please attach this to your bugreport

The problem seems to be specific to the SSE2 shift instructions. Other shifts such as logical/arithmetric shift right  are causing the same error.

The log file mentioned in the error message is in the attachment.



Version-Release number of selected component (if applicable):
gcc-4.1.1-51.fc6

How reproducible:
Always


Steps to Reproduce:
Just compile any code containing built-in SSE2 shift instructions.
For example:
#include <xmmintrin.h>

main() {
  __v8hi x;
  __v8hi y = __builtin_ia32_psllw128(x, (__v2di){0LL, 1LL});
}


Actual Results:
zain.C: In function ‘int main()’:
zain.C:5: internal compiler error: in ix86_expand_builtin, at config/i386/i386.c:16322
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccEdZBso.out file, please attach this to your bugreport

Expected Results:


Additional info:
Comment 1 Ali Erol 2007-03-22 14:39:29 EDT
Created attachment 150687 [details]
Preprocessed source stored for the sample code provided in the report
Comment 2 Jakub Jelinek 2007-03-23 16:16:42 EDT
Why do you use the builtins directly?  You should be using _mm_sll_epi16
(for 8xHI shifts or _mm_sll_epi32 for 4xSI or _mm_sll_epi64 for 2xDI shifts)
inline function, the builtins are an implementation detail.
Comment 3 Ali Erol 2007-03-24 05:25:57 EDT
Thanks a lot, using _mm_sll_epip16 solved our problem.  Our code was originally
written in assembly. Using builtins directly made the conversion a little bit
easier and as we did not have any problems with other instructions, we thought
it would be OK to use them directly.

Note You need to log in before you can comment on or make changes to this bug.