This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix for PR 37809 and 37807
Kaveh R. GHAZI wrote:
2008-10-19 Ralph Loader <suckfish@ihug.co.nz>
PR middle-end/37807, middle-end/37809
* combine.c (force_to_mode): Do not process vector types.
* rtlanal.c (nonzero_bits1): Do not process vector types.
(num_sign_bit_copies1): Likewise.
The testcase mmx-8.c crashes on the 4.3/4.2 branches, e.g.
http://gcc.gnu.org/ml/gcc-testresults/2008-11/msg01056.html
The fix for rtl-optimization/36438 [1], [2] needs to be backported to
4.3 and 4.2 branch.
[1] http://gcc.gnu.org/PR36438
[2] http://gcc.gnu.org/ml/gcc-patches/2008-06/msg00268.html
2008-11-13 Uros Bizjak <ubizjak@gmail.com>
Backport from mainline:
2008-06-06 Uros Bizjak <ubizjak@gmail.com>
PR rtl-optimization/36438
* cse.c (fold_rtx) [ASHIFT, LSHIFTRT, ASHIFTRT]: Break out early
for vector shifts with constant scalar shift operands.
testsuite/ChangeLog:
2008-11-13 Uros Bizjak <ubizjak@gmail.com>
Backport from mainline:
2008-06-06 Uros Bizjak <ubizjak@gmail.com>
PR rtl-optimization/36438
* gcc.target/i386/pr36438.c
Patch was bootstrapped and regression tested on x86_64-pc-linux-gnu
{,-m32} and committed to 4.3 branch. It will be committed to 4.2 after
regression test ends.
Uros.
Index: cse.c
===================================================================
--- cse.c (revision 141833)
+++ cse.c (working copy)
@@ -3505,6 +3505,11 @@
&& exact_log2 (- INTVAL (const_arg1)) >= 0)))
break;
+ /* ??? Vector mode shifts by scalar
+ shift operand are not supported yet. */
+ if (is_shift && VECTOR_MODE_P (mode))
+ break;
+
if (is_shift
&& (INTVAL (inner_const) >= GET_MODE_BITSIZE (mode)
|| INTVAL (inner_const) < 0))
Index: testsuite/gcc.target/i386/pr36438.c
===================================================================
--- testsuite/gcc.target/i386/pr36438.c (revision 0)
+++ testsuite/gcc.target/i386/pr36438.c (revision 0)
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mmmx" } */
+
+#include <mmintrin.h>
+
+extern __m64 SetS16 (unsigned short, unsigned short,
+ unsigned short, unsigned short);
+
+void
+foo (__m64 * dest)
+{
+ __m64 mask = SetS16 (0x00FF, 0xFF00, 0x0000, 0x00FF);
+
+ mask = _mm_slli_si64 (mask, 8);
+ mask = _mm_slli_si64 (mask, 8);
+
+ *dest = mask;
+
+ _mm_empty ();
+}