computation_cost too blind to hard regs
James E Wilson
wilson@specifixinc.com
Thu Jan 20 01:45:00 GMT 2005
DJ Delorie wrote:
> Am I missing something obvious here? We're creating a temporary
> sequence only to compute its cost, but we're using HARD registers in
> ways that they might not support (in my case, my backend aborted due
> to a subreg of a register in a mode it didn't support). In my case,
> using FIRST_PSEUDO_REGISTER intead of 0 as the initial regno works
> better.
There is similar code in init_expmed in expmed.c that uses a register
number of 10000. The number is arbitrary, but high enough to avoid
matching hard registers. We could use FIRST_PSEUDO_REGISTER here and it
would probably work just as well. In this case, though, we avoid
generating any RTL. We create just enough fake RTL to make rtx_cost happy.
In the computation_cost case, a pseudo-reg number is likewise better
than a hard reg number, but this one creates RTL. So we need to make
sure we don't accidentally create a pseudo-reg conflict, but since
gen_raw_REG is used here, it seems safe to use any pseudo register number.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com
More information about the Gcc
mailing list