fold-const.c (extract_muldiv_1): Do not distribute a multiplication by a power-of...
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 5 Jun 2019 14:14:40 +0000 (14:14 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Wed, 5 Jun 2019 14:14:40 +0000 (14:14 +0000)
commitc613138b6ce48448fa7f62dd03513d28919361d6
tree27268ad59c88a62106450ec1019ad35b0af6396d
parent2098f8ec2f82310104d1e3eb0a3ac0003e78600a
fold-const.c (extract_muldiv_1): Do not distribute a multiplication by a power-of-two value.

* fold-const.c (extract_muldiv_1) <PLUS_EXPR>: Do not distribute a
multiplication by a power-of-two value.
(fold_plusminus_mult_expr): Use pow2p_hwi to spot a power-of-two value
and turn the modulo operation into a masking operation.

From-SVN: r271963
gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/specs/discr6.ads [new file with mode: 0644]