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: RTL sharing tester (for testing)


> >>> Then the above error on SH went away.  This one liner may be
> >>> an overkill, but I hope that this experiment will help experts
> >>> to narrow down the problem.
> >> 
> >> Actually this seems like a correct fix for me. In fact I was just
> >> looking into instance of identical problem on PPC bootstrap (different
> >> file, same directory of libjava :).  We will copy iff the reg actually
> >> is subreg and in that case we are required to copy.
> >
> >Ok, but please let Jan run it thrugh your memory tester first.  (Jan, it 
> >may actually be best if you commit it in place of Kaz).
> >
> >Paolo
> 
> Three things:
> 
> (1) I think I would like to get some input from a middle-end
> maintainer or a gwm before this patch goes in.  This seems like a very
> heavy handed solution to this problem.  This is going to chew up the
> memory.

The users of df_set_note all just take the registers from dataflow
information and call the function to produce REG_DEAD/REG_UNUSED notes.
This all is going to introduce invalid sharing for subregs in all cases
and if we are going to produce the note with SUBREG, we simply must
produce the copy. (If we are very very cautious, we probably can have
some cache since we are probably recomputing those notes quite often,
but I doubt it is worth the extra complexity and we can see it easilly
from memory tester)

Note that copy_rtx does nothing for REG, since registers are shared, so
it should not be overly expensive and we simply must produce the
duplicate for the case of SUBREG or any other unshared RTL expression.

However I now wonder why do we want to see subregs there at all.
Originally I assumed that we now do partial liveness for multiple word
values, but it is not the case.  Perhaps the right thing to do is to
simply strip away the SUBREG and keep only the REG itself?
At least before dataflow, I don't think we produced SUBREGs in those
notes, I might be wrong.
>  
> (2) Kaz, one trick that you can try is to back out this
> patch and instead put a call to verify_rtl_sharing right after the
> assignment of REG_NOTES in df_set_note.
> 
>   /* Did not find the note.  */
>   REG_NOTES (insn) = alloc_EXPR_LIST (note_type, reg, REG_NOTES (insn));
>   verify_rtl_sharing ();
>   return old;
> 
> This will cause a failure when the shared note is inserted in the
> stream.  If you get into the debugger, the stacktrace should land you
> exactly at the place where the shared note is being inserted.
> 
> (3) Paolo, I tried the trick in (2) on pr32372 and it did not help.
> The reason is that the sharing in cse1 is caused by cse is taking
> something out of a reg_equal note and replacing an insn with it

My method of handling those problems is to simply put verify_rtl_sharing
now and then into the cse_insn spagetti function. Usually the
backtrace from gdb allows quickly to pinpoint the problematic
transformation.

Honza
> 
> Kenny


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