On 12/21/2017 10:54 AM, Jakub Jelinek wrote:
> Hi!
>
> Converting widening mult, or widen_{plus,minus}_expr, or integral mult to
> fma is IMNSHO undesirable with -ftrapv for signed types - the expansion of
> those doesn't detect overflows and by giving up we don't need to worry about
> formerly trapping MULT_EXPR becoming something that isn't trapping and
> performing EH cleanups etc.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>
> 2017-12-21 Jakub Jelinek <ja...@redhat.com>
>
> PR tree-optimization/83523
> * tree-ssa-math-opts.c (is_widening_mult_p): Return false if
> for INTEGER_TYPE TYPE_OVERFLOW_TRAPS.
> (convert_mult_to_fma): Likewise.
>
> * g++.dg/tree-ssa/pr83523.C: New test.
OK.
jeff