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: May delete_trivially_dead_insns delete trapping insns?


> Hi,
> 
> On Fri, 22 Nov 2002, Jan Hubicka wrote:
> 
> > We should delete the edges when the insns are deleted unless we are
> 
> delete_trivially_dead_insns() has no provisions for updating any edges.

It uses delete_insn_and_edges to remove the insns.
As name suggest that function should delete that.
> 
> > compiling for Java that requires the edges to be kept.
> 
> Why for Java, but not for other languages?  If there are no trapping insns

Because Java requires all exceptions to happen.  So you can't remove
dead insns that possibly trap.

> in a basic block there can't be exceptions edges.  That is _if_ we expect
> that d_t_d_i() retains the CFG at least basically, we either have to not
> delete trapping insns, or delete now dead edges.
> 
> > delete_dead_insn_and_edges should do that.
> 
> No such function in HEAD ;)  Anyway, purge_all_dead_edges() would work
> also.  The question is, _if_ we want to do that for d_t_d_i() at all.

The head says:
	  if (! live_insn)
	    {
	      count_reg_usage (insn, counts, NULL_RTX, -1);
	      delete_insn_and_edges (insn);
	      ndead++;
	    }
Oops, I see I misspelled the function name.
> 
> > What exactly is broken?
> 
> Well, simple.  Suppose a block only consisting of one trapping insn (like
> setting a pseudo to a value from memory).  Now that pseudo is used nowhere
> else.  In that case delete_trivially_dead_insns() will delete that insn,
> and suddenly the exception edge is superflous.  Those stray edges break
> e.g.  fixup_abnormal_edges() .
Can you take a look why delete_insn_and_edges didn't removed the
edge?

Honza
> 
> > I see perhaps what you are seeing is the scenario where trivially dead
> > insn is elliminated creating unreachable block that is not zapped then?
> 
> No, it's not unreachable.  It's simply not trapping anymore.
> 
> 
> Ciao,
> Michael.


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