This is the mail archive of the
mailing list for the GCC project.
Re: PATCH for alias set/stack temporary bug
- To: mark at markmitchell dot com
- Subject: Re: PATCH for alias set/stack temporary bug
- From: Jeffrey A Law <law at hurl dot cygnus dot com>
- Date: Wed, 10 Feb 1999 23:01:59 -0700
- cc: egcs-patches at cygnus dot com
- Reply-To: law at cygnus dot com
In message <199902102118.NAA11826@adsl-206-170-148-33.dsl.pacbell.net>you wri
> The compiler will cleverly reuse the same stack space for `s' and `t'.
> Unfortunately, the first few bytes of `s' and `t' are of different
> types, and are therefore assigned different alias sets. Therefore,
> the compiler "knows" that `s.i' and `t.d' do not alias, and feels free
> to make transformations depending on this fact. In this example,
> nothing untoward occurs, but I have real code involving many inline
> functions where this results in bad code.
> The solution is to clobber a stack slot (using alias set zero) right
> before reusing it. That lets the compiler know that uses of the
> (conceptually) new temporary should not be intermingled with uses of
> the original.
> Much of the changes to function.c below are just changes in
> indentation. The change to rtl.c is somewhat orthogonal: copy_rtx was
> not copying all of the fields that it should have been copying.
> Jeff, may I check this in?
> Mark Mitchell email@example.com
> Mark Mitchell Consulting http://www.markmitchell.com
> Wed Feb 10 10:00:29 1999 Mark Mitchell <firstname.lastname@example.org>
> * cse.c (dump_class): New function.
> (invalidate_memory): Fix typo in comment.
> * function.c (assign_stack_temp): Copy and clobber slots before
> reusing them.
> * rtl.c (copy_rtx): Copy all the flags (in particular,
I don't think this will actually work reliably.
Consider that CLOBBER insns are deleted after reload has completed. Thus,
nothing would prevent the second scheduling pass from reordering the insns
Hmmm, what other ways can we try to deal with this?