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: reload inheritance error breaks openssl on s390


Alexandre Oliva <aoliva@redhat.com> writes:

> After pondering on a solution for a bit, I realized the MEM_EXPRs
> would be carried over from the REG_EXPRs in the original pseudo, so we
> might as well just compare them to tell whether we're addressing the
> slot for the same pseudo.  I hope this is safe enough.  Failing that,
> we might have to fold the rtx, special-case this particular situation,
> or perhaps PLUS handling or somesuch.

I agree with Richard Sandiford that this approach isn't going to catch
all the cases where this problem can occur.  In principle this can
occur any time a register is spilled to an offset which is not
directly addressable.  In practice by the time we get to reload there
are plenty of registers around that don't refer to any decl and won't
have any attributes.

I should note that this optimization should not be handled in reload
at all.  This is simply dead store elimination, and there is no reason
that we shouldn't run a DSE pass after reload completes.  That would
be simpler, easier to understand, and would avoid this class of bugs.

The best way I can see to handle this is to add a new array similar to
reg_equiv_memory_loc and friends.  Then in find_reloads_address, if
the address changes, copy the original address into that array.  Then
use that array as well as reg_equiv_memory_loc in
delete_output_reload.

Ian


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