diff options
author | Jakub Jelinek <jakub@redhat.com> | 2022-11-12 09:33:01 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2022-11-12 09:33:01 +0100 |
commit | 2f7f9edd28d75a85a33599978f23811e679e443d (patch) | |
tree | efd57b30bd4fcaf4ec89b61be9c3910ca51f1513 /gcc/fortran | |
parent | f5225dbf5cf2a57ed5a2073b1a90a854093d063e (diff) | |
download | gcc-2f7f9edd28d75a85a33599978f23811e679e443d.zip gcc-2f7f9edd28d75a85a33599978f23811e679e443d.tar.gz gcc-2f7f9edd28d75a85a33599978f23811e679e443d.tar.bz2 |
range-op: Implement floating point multiplication fold_range [PR107569]
The following patch implements frange multiplication, including the
special case of x * x. The callers don't tell us that it is x * x,
just that it is either z = x * x or if (x == y) z = x * y;
For irange that makes no difference, but for frange it can mean
x is -0.0 and y is 0.0 if they have the same range that includes both
signed and unsigned zeros, so we need to assume result could be -0.0.
The patch causes one regression:
+FAIL: gcc.dg/fold-overflow-1.c scan-assembler-times 2139095040 2
but that is already tracked in PR107608 and affects not just the newly
added multiplication, but addition and other floating point operations
(and doesn't seem like a ranger bug but dce or whatever else).
2022-11-12 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/107569
PR tree-optimization/107591
* range-op.h (range_operator_float::rv_fold): Add relation_kind
argument.
* range-op-float.cc (range_operator_float::fold_range): Name
last argument trio and pass trio.op1_op2 () as last argument to
rv_fold.
(range_operator_float::rv_fold): Add relation_kind argument.
(foperator_plus::rv_fold, foperator_minus::rv_fold): Likewise.
(foperator_mult): New class.
(floating_op_table::floating_op_table): Use foperator_mult for
MULT_EXPR.
Diffstat (limited to 'gcc/fortran')
0 files changed, 0 insertions, 0 deletions