This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/66866] [miscompile] incorrect load address on manual vector shuffle
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 14 Jul 2015 12:51:26 +0000
- Subject: [Bug target/66866] [miscompile] incorrect load address on manual vector shuffle
- Auto-submitted: auto-generated
- References: <bug-66866-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66866
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
"Safe" fix:
Index: gcc/config/i386/i386.c
===================================================================
--- gcc/config/i386/i386.c (revision 225768)
+++ gcc/config/i386/i386.c (working copy)
@@ -50528,7 +50528,11 @@ ix86_expand_pinsr (rtx *operands)
}
if (GET_CODE (src) == SUBREG)
- src = SUBREG_REG (src);
+ {
+ if (SUBREG_BYTE (src) != 0)
+ return false;
+ src = SUBREG_REG (src);
+ }
switch (GET_MODE (dst))
{
but with awful consequences for code-generation (-O2, for the reduced
testcase):
_Z4shufDv2_x:
.LFB0:
.cfi_startproc
pxor %xmm1, %xmm1
movabsq $-4294901761, %rdx
movaps %xmm0, -24(%rsp)
movq -16(%rsp), %rax
movaps %xmm1, -24(%rsp)
movzwl %ax, %eax
salq $16, %rax
movq -16(%rsp), %rcx
andq %rcx, %rdx
orq %rax, %rdx
movq %rdx, -16(%rsp)
movdqa -24(%rsp), %xmm0
ret