Improve support for IMAGPART_EXPR and REALPART_EXPR in ranger.
authorAldy Hernandez <aldyh@redhat.com>
Fri, 3 Sep 2021 07:58:29 +0000 (09:58 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Fri, 3 Sep 2021 13:30:56 +0000 (15:30 +0200)
commitbccf4b88e184e925ee2d7931e4cf09704f1c3932
treef6d2a064075687dd01cca20343ecefd175296e47
parent4ce90454c2c81246be993d997cab12e21bc0be68
Improve support for IMAGPART_EXPR and REALPART_EXPR in ranger.

Currently we adjust statements containing an IMAGPART_EXPR if the
defining statement was one of a few built-ins known to return boolean
types.  We can also adjust statements for both IMAGPART_EXPR and
REALPART_EXPR where the defining statement is a constant.

This patch adds such support, and cleans up the code a bit.

Tested on x86-64 Linux.

gcc/ChangeLog:

* gimple-range-fold.cc (adjust_imagpart_expr): Move from
gimple_range_adjustment.  Add support for constants.
(adjust_realpart_expr): New.
(gimple_range_adjustment): Move IMAGPART_EXPR code to
adjust_imagpart_expr.
* range-op.cc (integral_table::integral_table): Add entry for
REALPART_CST.
gcc/gimple-range-fold.cc
gcc/range-op.cc