messy combine problem - PPC

Zack Weinberg zack@codesourcery.com
Mon Dec 3 22:34:00 GMT 2001


On Mon, Dec 03, 2001 at 06:27:06PM -0800, Richard Henderson wrote:
> On Mon, Dec 03, 2001 at 03:53:12PM -0800, Zack Weinberg wrote:
> > I'll try this, but will it inhibit desirable optimizations?
> 
> No.

I thought about it a bit more, and it can't ever inhibit an optimization,
but I am still worried about not recording registers that die in call
instructions.  Consider

  result = (*fptr) (args...);

where fptr is not used after that, and combine will see RTL such as 

  (set (reg:SI result)
       (call (reg:P fptr)))

or is there something else that takes care of that?

> > > Also, that should really be using regs_invalidated_by_call rather
> > > than call_used_regs.  Not that it'll make too much difference, 
> > > since we don't do a whole lot of combining with fixed registers.
> > 
> > Huh?
> 
>        for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
> -        if (call_used_regs[i])
> +	 if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i))

Oh, you meant the loop in record_dead_and_set_regs.

zw



More information about the Gcc mailing list