how to fix anti-optimization?

Richard Henderson rth@redhat.com
Fri Sep 14 13:36:00 GMT 2001


On Fri, Sep 14, 2001 at 12:50:47PM -0700, Dale Johannesen wrote:
> Some problems with this.  First, I discover that LEGITIMATE_CONSTANT_P on 
> rs6000 accepts some FP consts, after checking to see whether they can be 
> *moved* into int regs with 1 instruction per word.  That's not right, is 
> it?

Actually, it is.  While looking at a different problem, I remembered
that x86 does the same thing, since the best way to do "x = 2.0f" is
"movl $0x35800000,x".

I think you can just forget the LEGITIMATE_CONSTANT_P check.

> For this, the RT is to load from the array for the 1st two parameters, and 
> to do the multiplication at compile time, loading the resulting constant 
> 15.0 from a new memory loc.  So far I haven't been able to get that.

Hmm.  I'd expect cse_insn to be able to handle that...


r~



More information about the Gcc mailing list