[Bug c/23963] New: MMX intrinsics cause ICE in trunc_int_for_mode

2005-09-19 Thread sam at zoy dot org
The following code causes an ICE with any -O flag except -O0:

#include 
#include 
int main(int argc, char *argv[]) {
__m64 a, b, c;
a = b = c = (__m64)(uint64_t)argc; /* Load with arbitrary values */
a = _mm_slli_pi16(a, 3);
a = _mm_adds_pi16(a, b);
c = _mm_srli_pi16(c, 8);
c = _mm_slli_pi16(c, 3);
b = _mm_adds_pi16(b, c);
a = _mm_unpacklo_pi8(a, b);
return (int)(uint64_t)a;
}

Resulting error is:

crashmmx.c: In function ‘main’:
crashmmx.c:16: internal compiler error: in trunc_int_for_mode, at explow.c:53

-- 
   Summary: MMX intrinsics cause ICE in trunc_int_for_mode
   Product: gcc
   Version: 4.0.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sam at zoy dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: i486-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963


[Bug target/23963] [4.0 Regression] MMX intrinsics cause ICE in trunc_int_for_mode

2005-09-20 Thread sam at zoy dot org

--- Additional Comments From sam at zoy dot org  2005-09-20 22:28 ---
By the way, 4.1.0 fixes the bug on i486-linux-gnu, but on AMD64
(x86_64-linux-gnu) the problem is still present. Tested with a
20050904 snapshot.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963