[Bug tree-optimization/82816] [8 Regression] ICE on valid code at -Os and above: in find_widening_optab_handler_and_mode, at optabs-query.c:414

rsandifo at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Nov 6 14:48:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82816

--- Comment #2 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
Author: rsandifo
Date: Mon Nov  6 14:47:43 2017
New Revision: 254454

URL: https://gcc.gnu.org/viewcvs?rev=254454&root=gcc&view=rev
Log:
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.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr82816.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-math-opts.c


More information about the Gcc-bugs mailing list