]> gcc.gnu.org Git - gcc.git/commit
Handle non constant ranges in irange pretty printer.
authorAldy Hernandez <aldyh@redhat.com>
Tue, 26 Jul 2022 09:03:17 +0000 (11:03 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Tue, 26 Jul 2022 11:07:04 +0000 (13:07 +0200)
commit2615502971ca11c15f1949c03d93ccfe1ce54f55
treebc3e7a35f2b321061a5d1a836da510ac87d7ffd9
parent67248ad043b366d30e97cb6c192593057e798805
Handle non constant ranges in irange pretty printer.

Technically iranges only exist in constant form, but we allow symbolic
ones before arriving in the ranger, so legacy VRP can work.  This fixes the
ICE when attempting to print symbolic iranges in the pretty printer.

For consistency's sake, I have made sure irange::get_nonzero_bits does
not similarly ICE on a symbolic range, even though no one should be
querying nonzero bits on such a range.  This should all melt away
when legacy disappears, because all these methods are slated for
removal (min, max, kind, symbolic_p, constant_p, etc).

Finally, Richi suggested using pp_wide_int in the pretty printer
instead of going through trees.  I've adapted a test, since
dump_generic_node seems to work slightly different.

PR tree-optimization/106444

gcc/ChangeLog:

* value-range-pretty-print.cc (vrange_printer::visit): Handle
legacy ranges.
(vrange_printer::print_irange_bound): Work on wide_int's.
* value-range-pretty-print.h (print_irange_bound): Same.
* value-range.cc (irange::get_nonzero_bits): Handle legacy ranges.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/evrp4.c: Adjust.
gcc/testsuite/gcc.dg/tree-ssa/evrp4.c
gcc/value-range-pretty-print.cc
gcc/value-range-pretty-print.h
gcc/value-range.cc
This page took 0.070435 seconds and 6 git commands to generate.