]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/45400 (XBMC AudioEngine Compilation C++ Internal Compiler...
authorJakub Jelinek <jakub@redhat.com>
Wed, 25 Aug 2010 17:49:26 +0000 (19:49 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 25 Aug 2010 17:49:26 +0000 (19:49 +0200)
PR rtl-optimization/45400
* combine.c (simplify_shift_const_1) <case SUBREG>: Only use
SUBREG_REG if both modes are of MODE_INT class.

* g++.dg/other/i386-8.C: New test.

From-SVN: r163551

gcc/ChangeLog
gcc/combine.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/i386-8.C [new file with mode: 0644]

index bb6ebd99bdc9e7f57cdb78262f2ed3af49a52d0a..1123d07ce20839fd126934d41467477e998a7dde 100644 (file)
@@ -1,3 +1,9 @@
+2010-08-25  Jakub Jelinek  <jakub@redhat.com>
+
+       PR rtl-optimization/45400
+       * combine.c (simplify_shift_const_1) <case SUBREG>: Only use
+       SUBREG_REG if both modes are of MODE_INT class.
+
 2010-08-25  Julian Brown  <julian@codesourcery.com>
 
        * config/arm/arm.c (arm_issue_rate): Return 2 for Cortex-A5.
index 94e68392d98b74c3abaeb8864d0f3dc84000031b..acff54198e54c3ec36bc22aab56dffbd7bb4ab07 100644 (file)
@@ -9858,7 +9858,9 @@ simplify_shift_const_1 (enum rtx_code code, enum machine_mode result_mode,
                  > GET_MODE_SIZE (GET_MODE (varop)))
              && (unsigned int) ((GET_MODE_SIZE (GET_MODE (SUBREG_REG (varop)))
                                  + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD)
-                == mode_words)
+                == mode_words
+             && GET_MODE_CLASS (GET_MODE (varop)) == MODE_INT
+             && GET_MODE_CLASS (GET_MODE (SUBREG_REG (varop))) == MODE_INT)
            {
              varop = SUBREG_REG (varop);
              if (GET_MODE_SIZE (GET_MODE (varop)) > GET_MODE_SIZE (mode))
index 372024fd7cde6eaa251243f278c005d530ddd6e9..fd9f5ad3d0ae5ee2d01f55581f757d25ca296f52 100644 (file)
@@ -1,3 +1,8 @@
+2010-08-25  Jakub Jelinek  <jakub@redhat.com>
+
+       PR rtl-optimization/45400
+       * g++.dg/other/i386-8.C: New test.
+
 2010-08-25  Richard Guenther  <rguenther@suse.de>
 
        * gcc.dg/alias-8.c: Adjust.
diff --git a/gcc/testsuite/g++.dg/other/i386-8.C b/gcc/testsuite/g++.dg/other/i386-8.C
new file mode 100644 (file)
index 0000000..7de75c7
--- /dev/null
@@ -0,0 +1,23 @@
+// PR rtl-optimization/45400
+// { dg-do compile { target i?86-*-* x86_64-*-* } }
+// { dg-options "-O2 -msse2" }
+// { dg-options "-O2 -msse2 -fpic" { target fpic } }
+// { dg-require-effective-target sse2 }
+
+#include <xmmintrin.h>
+
+static inline unsigned short
+bar (unsigned short x)
+{
+  return ((x << 8) | (x >> 8));
+}
+
+unsigned int
+foo (float *x, short *y)
+{
+  __m128 a = _mm_set_ps1 (32767.5f);
+  __m128 b = _mm_mul_ps (_mm_load_ps (x), a);
+  __m64 c = _mm_cvtps_pi16 (b);
+  __builtin_memcpy (y, &c, sizeof (short) * 4);
+  y[0] = bar (y[0]);
+}