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.