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: Out-of-order update of new_spill_reg_store[]


On 10/11/11 14:35, Richard Sandiford wrote:
> No, reload 1 is inherited by a later instruction.  And it's inherited
> correctly, in terms of the register contents being what we expect.
> (Reload 1 is the one that survives to the end of the instruction's
> reload sequence.  Reload 2, in contrast, is clobbered by reload 1,
> so could not be inherited.  So when we record inheritance information
> in emit_reload_insns, reload_reg_reaches_end_p correctly stops us
> from recording reload 2 but allows us to record reload 1.)
> 
> The problem is that we record the wrong instruction for reload 1.
> We say that reload 1 is performed by the instruction that performs
> reload 2.  So spill_reg_store[] contains the instruction for reload 2
> rather than the instruction for reload 1.  We delete it in
> delete_output_reload at the point of inheritance.

Ok. So, would the minimal fix of testing !new_spill_reg_store[..] before
writing to it also work? Seems to me this would cope with the
out-of-order writes by only allowing the first.

If so, then I think I'd prefer that, but we could gcc_assert
(reload_reg_reaches_end (..)) as a bit of a verification of that function.


Bernd


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