PR82816: Widening multiplies of bitfields
commitf90f6ff196b73ccb207d51dd86f6ea6a4a126228
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 6 Nov 2017 14:47:43 +0000 (6 14:47 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 6 Nov 2017 14:47:43 +0000 (6 14:47 +0000)
treedf2bd2f49e457ed3f8d475a648f204ea8935d5e0
parent0ed49ed993051cc28cc5d97463cbe384653dee5c
PR82816: Widening multiplies of bitfields

In this PR we tried to create a widening multiply of two 3-bit numbers,
but that isn't a widening multiply at the optab/rtl level, since both
the input and output still have the same mode.

We could trap this either in is_widening_mult_p or (as the patch does)
in the routines that actually ask for an optab.  The latter seemed
more natural since is_widening_mult_p doesn't otherwise care about modes.

2017-11-03  Richard Sandiford  <richard.sandiford@linaro.org>
    Alan Hayward  <alan.hayward@arm.com>
    David Sherwood  <david.sherwood@arm.com>

gcc/
PR tree-optimization/82816
* tree-ssa-math-opts.c (convert_mult_to_widen): Return false
if the modes of the two types are the same.
(convert_plusminus_to_widen): Likewise.

gcc/testsuite/
* gcc.c-torture/compile/pr82816.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254454 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr82816.c [new file with mode: 0644]
gcc/tree-ssa-math-opts.c