On 01/22/2016 10:34 AM, Wilco Dijkstra wrote:
Improve TARGET_IRA_CHANGE_PSEUDO_ALLOCNO_CLASS target hook. It turns out there
is another case where the register allocator uses the union of register classes
without checking that the cost of the resulting register class is lower than
both (see https://gcc.gnu.org/ml/gcc-patches/2015-12/msg01765.html ).
It is hard to provide the best solution how to behave in this
situation. There are situations when choosing union class, if its cost
is less than memory, is a right solution. Sometimes it is not as in
this case. Probably, we could choose the best choice in RA adding modes
into consideration. The problem is also that many target hooks don't
consider all classes sometimes and based on a practice going from reload
pass times.
However, the patch itself is ok for me.
Thanks, Wilco.