https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67609

--- Comment #13 from Uroš Bizjak <ubizjak at gmail dot com> ---
The runtime version of the test still fails:

--cut here--
#include <emmintrin.h>

__m128d reg = { 2.0, 4.0 };

void
__attribute__((noinline))
set_lower (double b)
{
  double v[2];
  _mm_store_pd(v, reg);
  v[0] = b;
  reg = _mm_load_pd(v);
}

int
main ()
{
  set_lower (6.0);

  if (reg[1] != 4.0)
    abort ();

  return 0;
}
--cut here--

gcc -O2 -pr67609.c

$ ./a.out
Aborted

set_lower:
.LFB518:
        movdqa  reg(%rip), %xmm1        # 6     *movti_internal/4
>>      movapd  %xmm0, %xmm1    # 7     *movdf_internal/14
        movaps  %xmm1, reg(%rip)        # 8     *movv2df_internal/3
        ret     # 14    simple_return_internal

Marked insn moves the whole register and clobbers the high word of the xmm1.

Reply via email to