From d708ce50e3a360ff34f855ce9089b040d1c87d74 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 19 Apr 2011 18:47:06 +0200 Subject: [PATCH] =?utf8?q?re=20PR=20target/48678=20(unable=20to=20find=20a?= =?utf8?q?=20register=20to=20spill=20in=20class=20=E2=80=98GENERAL=5FREGS?= =?utf8?q?=E2=80=99)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit PR target/48678 * config/i386/i386.md (movstrict): FAIL if operands[0] is a SUBREG with non-MODE_INT mode inside of it. * gcc.target/i386/pr48678.c: New test. From-SVN: r172721 --- gcc/ChangeLog | 6 ++++++ gcc/config/i386/i386.md | 3 +++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/pr48678.c | 16 ++++++++++++++++ 4 files changed, 30 insertions(+) create mode 100644 gcc/testsuite/gcc.target/i386/pr48678.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5c44ebda4f4..959d07b8008 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-04-19 Jakub Jelinek + + PR target/48678 + * config/i386/i386.md (movstrict): FAIL if operands[0] + is a SUBREG with non-MODE_INT mode inside of it. + 2011-04-19 Martin Jambor * ipa-cp.c (ipcp_process_devirtualization_opportunities): Devirtualize diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 0e0ceed4260..38bdcd30c10 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -2425,6 +2425,9 @@ { if (TARGET_PARTIAL_REG_STALL && optimize_function_for_speed_p (cfun)) FAIL; + if (GET_CODE (operands[0]) == SUBREG + && GET_MODE_CLASS (GET_MODE (SUBREG_REG (operands[0]))) != MODE_INT) + FAIL; /* Don't generate memory->memory moves, go through a register */ if (MEM_P (operands[0]) && MEM_P (operands[1])) operands[1] = force_reg (mode, operands[1]); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 71c4556ea0e..0d47ecfb65d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-04-19 Jakub Jelinek + + PR target/48678 + * gcc.target/i386/pr48678.c: New test. + 2011-04-19 Martin Jambor * g++.dg/opt/devirt1.C: Bump to -O2, remove XFAIL. diff --git a/gcc/testsuite/gcc.target/i386/pr48678.c b/gcc/testsuite/gcc.target/i386/pr48678.c new file mode 100644 index 00000000000..6f6727fffa2 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr48678.c @@ -0,0 +1,16 @@ +/* PR target/48678 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -msse2" } */ + +#include + +typedef short T __attribute__((may_alias)); +struct S { __m128i d; }; + +__m128i +foo (short *x, struct S *y, __m128i *z) +{ + struct S s = *y; + ((T *) &s.d)[0] = *x; + return _mm_cmpeq_epi16 (s.d, *z); +} -- 2.30.2