I am using
  gcc version 3.4.5 (Gentoo 3.4.5, ssp-3.4.5-1.0, pie-8.7.9)
on
  Linux 2.6.15-gentoo-r1 #1 PREEMPT Tue Mar 21 18:53:15 CET 2006 Intel(R)
Pentium(R) M processor 1.60GH


Following code crashes gcc when compiled with 
> gcc -O2 -msse2 -c test3.cpp
or
> gcc -O3 -msse2 -c test3.cpp

// --------------------------------
#include <emmintrin.h>

void foo(double* x, bool cond)
{

  __m128d zero = _mm_setzero_pd();
  _mm_store_sd(x, zero);

  if (cond)
  {
        __m128d one = _mm_set_sd(1);
        _mm_store_sd(x, one);
  }

}
// --------------------------------

gcc output:
test3.cpp: In function `void foo(double*, bool)':
test3.cpp:15: error: unrecognizable insn:
(insn:HI 122 23 54 0 (set (reg:DF 79)
        (vec_select:DF (reg:V2DF 63)
            (parallel [
                    (const_int 0 [0x0])
                ]))) -1 (insn_list 23 (nil))
    (expr_list:REG_DEAD (reg:V2DF 63)
        (nil)))
test3.cpp:15: internal compiler error: in extract_insn, at recog.c:2083

The compilation works when using -O1 instead of -O2.

It does not matter what values the variables zero and one are set to,
as long as the values are different. Even following gives the crash:

#include <emmintrin.h>

void foo(double* x, bool cond)
{

  __m128d zero;
  _mm_store_sd(x, zero);

  if (cond)
  {
        __m128d one;
        _mm_store_sd(x, one);
  }

}


-- 
           Summary: ice with sse intrinsics (unrecognizable insn)
           Product: gcc
           Version: 3.4.5
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gcc at povworld dot org
  GCC host triplet: i686-pc-linux-gnu


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

Reply via email to