[Bug tree-optimization/90510] New: [10 Regression] Unnecessary permutation

hjl.tools at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu May 16 22:20:00 GMT 2019


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

            Bug ID: 90510
           Summary: [10 Regression] Unnecessary permutation
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: rguenther at suse dot de
  Target Milestone: ---

On x86-64, r271153 caused:

[hjl@gnu-cfl-1 pr54855]$ cat 5.i
typedef double __v2df __attribute__ ((__vector_size__ (16)));

__v2df
_mm_add_sd (__v2df x, __v2df y)
{
  __v2df z = { (x[0] + y[0]), x[1] };
  return z;
}
[hjl@gnu-cfl-1 pr54855]$
/export/build/gnu/tools-build/gcc-debug/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/tools-build/gcc-debug/build-x86_64-linux/gcc/ -O2  -S 5.i
[hjl@gnu-cfl-1 pr54855]$  cat 5.s
        .file   "5.i"
        .text
        .p2align 4
        .globl  _mm_add_sd
        .type   _mm_add_sd, @function
_mm_add_sd:
.LFB0:
        .cfi_startproc
        movapd  %xmm0, %xmm2
        addsd   %xmm1, %xmm2
        unpcklpd        %xmm2, %xmm2  <<<< This isn't needed.
        movsd   %xmm2, %xmm0
        ret
        .cfi_endproc
.LFE0:
        .size   _mm_add_sd, .-_mm_add_sd
        .ident  "GCC: (GNU) 10.0.0 20190514 (experimental)"
        .section        .note.GNU-stack,"",@progbits
[hjl@gnu-cfl-1 pr54855]$ 

instead of

_mm_add_sd:
.LFB0:
        .cfi_startproc
        movapd  %xmm0, %xmm2
        addsd   %xmm1, %xmm2
        movsd   %xmm2, %xmm0
        ret
        .cfi_endproc


More information about the Gcc-bugs mailing list