optabs: Don't use scalar conversions for vectors [PR93843]
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 25 Feb 2020 19:20:58 +0000 (19:20 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Wed, 26 Feb 2020 12:46:59 +0000 (12:46 +0000)
commitb6268016bf46dd63227dcbb73d13c30a3b4b9d2a
tree6d54c20e191f38ffdf3b5bb4d5976ca8bf4d1307
parent67fa274cd635ec3c8af635294b67f09e45e3c56a
optabs: Don't use scalar conversions for vectors [PR93843]

In this PR we had a conversion between two integer vectors that
both had scalar integer modes.  We then tried to implement the
conversion using the scalar optab for those modes, instead of
doing the conversion elementwise.

I wondered about letting through scalar modes for single-element
vectors, but I don't have any evidence that that's useful/necessary,
so it seemed better to keep things simple.

2020-02-26  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
PR middle-end/93843
* optabs-tree.c (supportable_convert_operation): Reject types with
scalar modes.

gcc/testsuite/
PR middle-end/93843
* gcc.dg/vect/pr93843-1.c: New test.
* gcc.dg/vect/pr93843-2.c: Likewise.
gcc/ChangeLog
gcc/optabs-tree.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr93843-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/pr93843-2.c [new file with mode: 0644]