This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug optimization/11627] internal compiler error: in push_reload, at reload.c:1282


------- Additional Comments From bbrand at nki dot nl  2003-12-02 10:17 -------
Hello,

The MinGW developers suggested that I should add the following bug report
to this existing bug since it is probably the same one but with a much
smaller source to trigger it. (Item #852092 on MinGW's bug tracker for
the original report.)

Platform: windows NT4 sp6a
> gcc --version
gcc.exe (GCC) 3.3.1 (mingw special 20030804-1)
> grep __MINGW32_VERSION \lang\mingw331
\include\_mingw.h
#define __MINGW32_VERSION 3.2

Compilation of sse2 instructions using -msse2,
-mcpu=pentium4 or -march=pentium4 together
with optimization -O, -O1 or higher generates an
internal compiler error.

Preprocessed code:

typedef int __v4si __attribute__ ((__mode__(__V4SI__)));
typedef int __v2di __attribute__ ((mode (V2DI)));
typedef int __v8hi __attribute__ ((mode (V8HI)));

static __inline __v2di
_mm_add_epi32 (__v2di __A, __v2di __B)
{
  return (__v2di)__builtin_ia32_paddd128 ((__v4si)__A, (__v4si)__B);
}

static __inline __v2di
_mm_madd_epi16 (__v2di __A, __v2di __B)
{
  return (__v2di)__builtin_ia32_pmaddwd128 ((__v8hi)__A, (__v8hi)__B);
}

static __inline __v2di
_mm_srai_epi32 (__v2di __A, int __B)
{
  return (__v2di)__builtin_ia32_psradi128 ((__v4si)__A, __B);
}

static __inline __v2di
_mm_mulhi_epu16 (__v2di __A, __v2di __B)
{
  return (__v2di)__builtin_ia32_pmulhuw128 ((__v8hi)__A, (__v8hi)__B);
}

void test(void)
{
  short *p;
  int *q;
  __v2di v, u, w, _xf, _yf, _yf1;

  for(;;)
  {
    int a = __builtin_ia32_pextrw128 ((__v8hi)v, 0);
    w = ((__v2di)__builtin_ia32_pinsrw128 ((__v8hi)w, p[a+1], 7));

    v = _mm_mulhi_epu16(_yf1, _xf);
    u = _mm_madd_epi16(u, v);

    v = _mm_mulhi_epu16(_yf, _xf);
    w = _mm_madd_epi16(w, v);
    u = _mm_add_epi32(u, w);

    u = _mm_srai_epi32(u, 15);
    *(__v2di *)(q) = _mm_add_epi32(*(__v2di *)(q), u);
  }
}

Compile with e.g.:
gcc -c -O2 -msse2 prob3.i
or (rename snippet to prob3.ii):
g++ -c -O -march=pentium4 prob3.ii

Compiler output:
prob3.c: In function `test':
prob3.c:50: internal compiler error: in push_reload, at 
reload.c:1261
Please submit a full bug report,
with preprocessed source if appropriate.

The code snipped is very much reduced. Removing
any further lines or removal of the loop removes the
internal compiler error.

Manually substituting the _mm_... functions with the
__builtin_ia32_... functions as defined in xmmintrinsic.h
(or as shown in the preprocessed snipped above)
changes the internal compiler error from one in
push_reload to:
internal compiler error: in ix86_expand_binop_builtin, 
at config/i386/i386.c:13113

Possibly a red herring: a slightly larger snipped did
compile when for(;;) was changed into while(1),
in the above snippet this does not matter.

Regards,

Bob Brand


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]