User account creation filtered due to spam.

Bug 23963 - [4.0 Regression] MMX intrinsics cause ICE in trunc_int_for_mode
Summary: [4.0 Regression] MMX intrinsics cause ICE in trunc_int_for_mode
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.0.2
: P2 normal
Target Milestone: 4.1.2
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code, ssemmx
Depends on:
Blocks:
 
Reported: 2005-09-19 11:06 UTC by Sam Hocevar
Modified: 2007-02-03 15:43 UTC (History)
3 users (show)

See Also:
Host:
Target: x86_64-*-*-*
Build:
Known to work: 4.2.0 3.4.0 4.1.2
Known to fail: 4.0.2
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Hocevar 2005-09-19 11:06:56 UTC
The following code causes an ICE with any -O flag except -O0:

#include <mmintrin.h>
#include <stdint.h>
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
Comment 1 Sam Hocevar 2005-09-20 22:28:18 UTC
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.
Comment 2 Andrew Pinski 2006-06-05 04:49:32 UTC
This works with 4.2.0 on x86_64-*-* though not for 4.1.0.
Comment 3 Wolfgang Bangerth 2006-09-13 03:34:25 UTC
This appears to be working now on x86_64 with last night's gcc 4.1.x subversion.
Comment 4 Richard Biener 2006-10-17 13:39:35 UTC
This works for me with 4.1.2.
Comment 5 Gabriel Dos Reis 2007-02-03 15:43:39 UTC
Fixed in GCC-4.1.2 and higher.