This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Committed, MMIX: fix PR43889, missing earlyclobber exposed by r154688


On 04/27/2010 03:41 PM, Hans-Peter Nilsson wrote:

>> Before reload, nothing tells the compiler that the inputs will be
>> clobbered,
> 
> The "="s do, where need be.  Before reload (really: before
> register allocation) no temporaries are needed.  For inputs that
> don't die in the insn, register allocation will handle the
> temporaries housekeeping.
> 
>> and the divdi3 expander shouldn't produce a pattern that
>> clobbers the inputs.
> 
> What's wrong with that?  I don't copy the inputs to temporaries
> in the movdi3/divdi3 expanders, but that's just slightly
> unhelpful to the register allocator, not wrong.  Is that what
> you mean?

Okay, let's say you have a sequence

  (set (reg A) (reg B))
  (parallel [(set (reg C) (div (reg B) (something)))
             (clobber (scratch))])
  (use (reg A))

What's to prevent the compiler from replacing the final use of A with a
use of B?  Then, after reload, you get

  (set (reg 1) (reg 2))
  (parallel [(set (reg 3) (div (reg 2) (something)))
             (clobber (reg 2))])
  (use (reg 2))

And you end up using a clobbered register.


Bernd


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]