]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/59261 (FAIL: gcc.dg/vect/bb-slp-26.c -flto -ffat-lto-objects (intern...
authorJakub Jelinek <jakub@redhat.com>
Tue, 4 Feb 2014 09:36:18 +0000 (10:36 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 4 Feb 2014 09:36:18 +0000 (10:36 +0100)
PR middle-end/59261
* expmed.c (expand_mult): For MODE_VECTOR_INT multiplication
if there is no vashl<mode>3 or ashl<mode>3 insn, skip_synth.

* gcc.dg/pr59261.c: New test.

From-SVN: r207456

gcc/ChangeLog
gcc/expmed.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr59261.c [new file with mode: 0644]

index 93a502f399ff94ba0d1a0e52fb5af406941fe760..5487d5c3246cf607d19217c9dace8fe05e3b662d 100644 (file)
@@ -1,3 +1,9 @@
+2014-02-04  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/59261
+       * expmed.c (expand_mult): For MODE_VECTOR_INT multiplication
+       if there is no vashl<mode>3 or ashl<mode>3 insn, skip_synth.
+
 2014-02-04  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/60012
index 8f4b008d58989b2e0d97312e2f624d6f5c91effd..7c1c979f7741bf9a280855c1cc51796b805f11de 100644 (file)
@@ -3136,6 +3136,14 @@ expand_mult (enum machine_mode mode, rtx op0, rtx op1, rtx target,
       if (do_trapv)
        goto skip_synth;
 
+      /* If mode is integer vector mode, check if the backend supports
+        vector lshift (by scalar or vector) at all.  If not, we can't use
+        synthetized multiply.  */
+      if (GET_MODE_CLASS (mode) == MODE_VECTOR_INT
+         && optab_handler (vashl_optab, mode) == CODE_FOR_nothing
+         && optab_handler (ashl_optab, mode) == CODE_FOR_nothing)
+       goto skip_synth;
+
       /* These are the operations that are potentially turned into
         a sequence of shifts and additions.  */
       mode_bitsize = GET_MODE_UNIT_BITSIZE (mode);
index f630cd974d1f6da8feffd936d725535996546bc7..048a02909e3b70c116e8b8cf4711458c16857c2b 100644 (file)
@@ -1,3 +1,8 @@
+2014-02-04  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/59261
+       * gcc.dg/pr59261.c: New test.
+
 2014-02-04  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/60012
diff --git a/gcc/testsuite/gcc.dg/pr59261.c b/gcc/testsuite/gcc.dg/pr59261.c
new file mode 100644 (file)
index 0000000..6b912de
--- /dev/null
@@ -0,0 +1,17 @@
+/* PR middle-end/59261 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef signed char V __attribute__((vector_size (8)));
+
+void
+foo (V *a, V *b)
+{
+  *a = *b * 3;
+}
+
+void
+bar (V *a, V *b)
+{
+  *a = *b * 4;
+}