Now that Kazu has reorganized fold's internal APIs, its possible to
trivially implement fold_binary_to_constant using fold_binary and
fold_unary_to_constant using fold_unary. Using the obvious two line
implementations of these functions, avoids creating the tree node
that was the original motiviation for these routines, but also allows
us to catch more optimizations and at the same time reduce the code
duplication.
This patch shrinks fold-const.c by nearly 500 lines (or by over 4%).
Here are some statistics that show that the potential increase in
memory usage, due to constructing a tree that we then ignore, is
negligable: