This is the mail archive of the 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]

Re: PATCH for alias set/stack temporary bug

  In message <>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
  > Mark Mitchell Consulting
  > Wed Feb 10 10:00:29 1999  Mark Mitchell  <>
  > 	* 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?


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