This is the mail archive of the gcc@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: Deleting jump tables and CFG


> In message <20031201171121.GB15555@kam.mff.cuni.cz>, Jan Hubicka writes:
>  >>     Unfrortuantely it is not easy to track and delete all references to
>  >>     the dead jumptable immediately when it becomes unreachable or
>  >>     simplifies to simplejump as there can be code computing the jumptable
>  >>     destination.  Thus the strategy is to remove the jumptables after
>  >>     liveness analysis via purge_dead_jumptables call.  This is causing
>  >>     problems all the time.  It would be nice to move the jumptables out of
>  >>     the instruction chain (as rest of datas are dealt with) so the dead
>  >>     jumptables won't affect other optimizations.
>  >> 
>  >> The problem is that code to delete unreachable blocks is deleting the label
>  >s
>  >> referenced by a jumptable but not the table itself.  So when jump.c runs, i
>  >t
>  >> blows up since the CODE_LABELs have been GC'ed.
>  >
>  >Do you have some testcase to look at?
>  >This looks like quite nasty problem.  Perhaps we can manage
>  >delete_unreachable_blocks to turn affected CODE_LABELs into
>  >NOTE_INSN_DEAD_LABEL instead of deleting them, but it is not completely
>  >trivial to track down what labels are accessed via jumptables and we
>  >don't have any machinery to delete those notes, so we should not create
>  >too many of these...
> Err, shouldn't the reference to the CODE_LABEL from within the jump table
> have kept the GC system from garbage collecting the CODE_LABEL node?

I went into assumption that GGC thinks that 'u' does not point into RTL
not accessible via normal INSN chain, but it does not appear to be the
case,  'u' is not handled specially by ggc_mark_rtx_children, so I guess
this is some kind of memory corruption.

HOnza
> 
> 
> Jeff


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