aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2014-02-04 10:36:18 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2014-02-04 10:36:18 +0100
commit66b3ed5f3da50ca525401c340279f76679bd2c87 (patch)
tree2a95d5d3aa1b211a77a06fcecf189456d3381d9f
parent5961d779d0f20b61363091ac7849d457cc80275d (diff)
downloadgcc-66b3ed5f3da50ca525401c340279f76679bd2c87.zip
gcc-66b3ed5f3da50ca525401c340279f76679bd2c87.tar.gz
gcc-66b3ed5f3da50ca525401c340279f76679bd2c87.tar.bz2
re PR middle-end/59261 (FAIL: gcc.dg/vect/bb-slp-26.c -flto -ffat-lto-objects (internal compiler error))
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
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/expmed.c8
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr59261.c17
4 files changed, 36 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 93a502f..5487d5c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 8f4b008..7c1c979 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -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);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f630cd9..048a029 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..6b912de
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr59261.c
@@ -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;
+}