This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
gcc-3.3 ICE error using -msse2 -O3 in pentium4-pc-linux-gnu
- From: Guillermo Ballester Valor <gbv at oxixares dot com>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 25 Apr 2003 01:24:00 +0200
- Subject: gcc-3.3 ICE error using -msse2 -O3 in pentium4-pc-linux-gnu
Hi,
Today I've installed CVS gcc-3.3 compiler and bootstraped OK
I've wrote a code to perform Lucas-Lehmer Test to check whether a Mersenne
number is prime (see http://glucas.sourceforge.net/ ). I'm now writing SSE2
code to be used on Opterons and Pentium4, calling to built_in intrinsic SSE2
libraries. Up to now, it runned OK for both Athlon/gcc-3.2 (using emulated
sse2 code) and Intel C++ compiler with (true SSE2 code).
When I try to use gcc-3.3 compiler then I get the following error, It is not
produced when I supress the -O optimization flag (-01 -O2 and -O3 does the
same) :
gcc-3.3 -S -DHAVE_CONFIG_H -I. -O3 -mcpu=pentium4 -march=pentium4 -msse2
-DNO_HACK_ALIGN -DY_TARGET=0 -DY_AVAL=4 -DY_CACHE_LINE=16 -DY_SECURE
-DY_USE_SSE2 -DY_PENTIUM4 -o radixmm_8.s radixmm_8.c
radixmm_8.c: En la función `radixmm0_8_dif':
radixmm_8.c:361: internal compiler error: in simplify_unary_operation, at
simplify-rtx.c:387
Por favor envíe un reporte completo de `bugs',
con el código preprocesado si es apropiado.
Vea <URL:http://gcc.gnu.org/bugs.html> para más instrucciones.
make: *** [radixmm_8.s] Error 1
gbv at bach:~> gcc-3.3 -v
Leyendo especificaciones de
/usr/local/gcc-3.3/lib/gcc-lib/i686-pc-linux-gnu/3.3/specs
Configurado con: /home/gbv/gcc-3.3/gcc/configure --prefix=/usr/local/gcc-3.3
--program-suffix=-3.3
Modelo de hilos: posix
gcc versión 3.3 20030424 (prerelease)
I was a few lost. I think it is a bug but I didn't know how can I send you an
easy test to show the problem, the resulting radixmm_8.i is unreadable due to
the recursed expansion of large macros.
Fortunately, I've been able to write a small test to show the problem. Again,
Intel C++ compiler runs OK.
gbv at bach:~/glucas/glucas-2.9.1> gcc-3.3 -O3 -mcpu=pentium4 -msse2 sse2test.c
-o sse2test
sse2test.c: En la función `main':
sse2test.c:87: internal compiler error: in simplify_unary_operation, at
simplify-rtx.c:387
Por favor envíe un reporte completo de `bugs',
con el código preprocesado si es apropiado.
Vea <URL:http://gcc.gnu.org/bugs.html> para más instrucciones.
And attached is the offending code
Guillermo.
--
Guillermo Ballester Valor
gbv at oxixares dot com
Ogijares, Granada SPAIN
/*
This is a test for sse2 intrinsic libraries for GCC 3.3
*/
#include <stdlib.h>
#if defined(__ICC)
#include <emmintrin.h>
#else
#include <xmmintrin.h>
#endif
#include <stdio.h>
typedef __m128d Y__M128D;
#define Y_MM_LOAD_PD( _res, _p) _res = _mm_load_pd(_p)
#define Y_MM_LOAD1_PD( _res, _p) _res = _mm_load1_pd(_p)
#define Y_MM_SET_SD( _res, _op) _res = _mm_set_sd( _op)
#define Y_MM_SET1_PD( _res, _op) _res = _mm_set1_pd( _op )
#define Y_MM_STORE_PD( _p, _op) _mm_store_pd( _p, _op)
#define Y_MM_UNPACKHI_PD( _res, _op1, _op2) _res = _mm_unpackhi_pd( _op1, _op2)
#define Y_MM_UNPACKLO_PD( _res, _op1, _op2) _res = _mm_unpacklo_pd( _op1, _op2)
#define Y_MM_ADD_PD( _res, _op1, _op2) _res = _mm_add_pd( _op1, _op2)
#define Y_MM_ADD_SD( _res, _op1, _op2) _res = _mm_add_sd( _op1, _op2)
#define Y_MM_SUB_PD( _res, _op1, _op2) _res = _mm_sub_pd( _op1, _op2)
#define Y_MM_SUB_SD( _res, _op1, _op2) _res = _mm_sub_sd( _op1, _op2)
#define Y_MM_MUL_PD( _res, _op1, _op2) _res = _mm_mul_pd( _op1, _op2)
#define Y_MM_MOV_PD( _res, _op1) _res = _op1
#define Y_MM_SWAP_PD( _res ) _res = _mm_shuffle_pd( _res, _res, 0x01)
# define sse2_muladdsub(_t0,_t1,_f) \
{ \
Y__M128D __ar,__ai,__br, __bi; \
Y_MM_MUL_PD(__br, _t1##i, _f##i); \
Y_MM_MUL_PD(__bi, _t1##i, _f##r); \
Y_MM_MUL_PD(__ar, _t1##r, _f##r); \
Y_MM_MUL_PD(__ai, _t1##r, _f##i); \
Y_MM_SUB_PD(__ar, __ar, __br); \
Y_MM_MOV_PD(__br, _t0##r); \
Y_MM_ADD_PD(__ai, __ai, __bi); \
Y_MM_MOV_PD(__bi, _t0##i); \
Y_MM_ADD_PD(_t0##r, _t0##r, __ar); \
Y_MM_SUB_PD(_t1##r, __br, __ar); \
Y_MM_ADD_PD(_t0##i, _t0##i, __ai); \
Y_MM_SUB_PD(_t1##i, __bi, __ai); \
}
#define double_to_sse2(_t, _s) \
{ \
Y__M128D __aux1, __aux2; \
Y_MM_SET_SD ( __aux1, _s##r);\
Y_MM_SET_SD ( __aux2, _s##i);\
Y_MM_UNPACKLO_PD ( _t, __aux1, __aux2);\
}
int main(int argc, char * argv[])
{
double t0r=0.3 , t0i=0.4 , t1r= (-1.2), t1i= 0.2, twr=1.1, twi=0.9;
Y__M128D xt0r, xt0i, xt1r, xt1i, xtwr, xtwi;
double_to_sse2 ( xt0r, t0);
double_to_sse2 ( xt1r, t1);
double_to_sse2 ( xtwr, tw);
Y_MM_MOV_PD(xt0i, xt0r);
Y_MM_MOV_PD(xt1i, xt1r);
Y_MM_MOV_PD(xtwi, xtwr);
sse2_muladdsub ( xt0, xt1, xtw);
_mm_store_pd ( &t0r, xt0r);
_mm_store_pd ( &t1r, xt0r);
printf("%lf\n",t0r);
return;
}