Re: [PATCH] Fix ICE in distribute_notes (PR bootstrap/51796)

2012-01-11 Thread Eric Botcazou
> If you prefer to do it this way, fine, but I think we should have some > ENABLE_RTL_CHECKING verification somewhere that the REG_NORETURN vs. > REG_ARGS_SIZE ordering is always correct. OK, this is clearly going ouf of proportion. :-) Your latest patch is fine. -- Eric Botcazou

Re: [PATCH] Fix ICE in distribute_notes (PR bootstrap/51796)

2012-01-11 Thread Jakub Jelinek
On Wed, Jan 11, 2012 at 01:59:59PM +0100, Eric Botcazou wrote: > > I'd find that very fragile. E.g. distribute_notes itself reverses the > > order of all notes, and for no REG_NOTES I think we rely on any ordering. > > AFAIK distribute_notes is the only routine that redistributes the RTL notes >

Re: [PATCH] Fix ICE in distribute_notes (PR bootstrap/51796)

2012-01-11 Thread Eric Botcazou
> I'd find that very fragile. E.g. distribute_notes itself reverses the > order of all notes, and for no REG_NOTES I think we rely on any ordering. AFAIK distribute_notes is the only routine that redistributes the RTL notes for a fixed insn, so I'm a little skeptical about the purported fragilit

Re: [PATCH] Fix ICE in distribute_notes (PR bootstrap/51796)

2012-01-11 Thread Jakub Jelinek
On Wed, Jan 11, 2012 at 10:28:55AM +0100, Eric Botcazou wrote: > > IMHO reordering the notes in the chain would be even more work than this. > > Can't we just move down the lines > > if (ecf_flags & ECF_NORETURN) > add_reg_note (call_insn, REG_NORETURN, const0_rtx); > > if (ecf_flags & E

Re: [PATCH] Fix ICE in distribute_notes (PR bootstrap/51796)

2012-01-11 Thread Eric Botcazou
> IMHO reordering the notes in the chain would be even more work than this. Can't we just move down the lines if (ecf_flags & ECF_NORETURN) add_reg_note (call_insn, REG_NORETURN, const0_rtx); if (ecf_flags & ECF_RETURNS_TWICE) { add_reg_note (call_insn, REG_SETJMP, const0_rtx);

Re: [PATCH] Fix ICE in distribute_notes (PR bootstrap/51796)

2012-01-11 Thread Jakub Jelinek
On Wed, Jan 11, 2012 at 10:06:55AM +0100, Eric Botcazou wrote: > > You're right. So how about this patch (untested so far) instead? > > In the combiner it still needs to handle the case where REG_NORETURN note > > hasn't been placed yet, because then fixup_args_size_notes doesn't consider > > it b

Re: [PATCH] Fix ICE in distribute_notes (PR bootstrap/51796)

2012-01-11 Thread Eric Botcazou
> You're right. So how about this patch (untested so far) instead? > In the combiner it still needs to handle the case where REG_NORETURN note > hasn't been placed yet, because then fixup_args_size_notes doesn't consider > it being a noret call. Still too much work for the combiner in my opinion.

Re: [PATCH] Fix ICE in distribute_notes (PR bootstrap/51796)

2012-01-11 Thread Jakub Jelinek
On Wed, Jan 11, 2012 at 09:16:04AM +0100, Eric Botcazou wrote: > > And for noreturn calls, it doesn't do anything wrong, the problem is that it > > returns the old size for them. > > According to the head comment, that's precisely the problem, since it should > do > something for them, in parti

Re: [PATCH] Fix ICE in distribute_notes (PR bootstrap/51796)

2012-01-11 Thread Eric Botcazou
> And for noreturn calls, it doesn't do anything wrong, the problem is that it > returns the old size for them. According to the head comment, that's precisely the problem, since it should do something for them, in particular put back the note. -- Eric Botcazou

Re: [PATCH] Fix ICE in distribute_notes (PR bootstrap/51796)

2012-01-10 Thread Jakub Jelinek
On Tue, Jan 10, 2012 at 09:19:54PM +0100, Eric Botcazou wrote: > > 2012-01-10 Jakub Jelinek > > > > PR bootstrap/51796 > > * combine.c (distribute_notes): If i3 is a noreturn call, > > allow old_size to be equal to args_size. > > Wouldn't all the (potential) callers of fixup_args_si

Re: [PATCH] Fix ICE in distribute_notes (PR bootstrap/51796)

2012-01-10 Thread Eric Botcazou
> 2012-01-10 Jakub Jelinek > > PR bootstrap/51796 > * combine.c (distribute_notes): If i3 is a noreturn call, > allow old_size to be equal to args_size. Wouldn't all the (potential) callers of fixup_args_size_notes need to do the same kind of scanning? IOW, shouldn't this be

[PATCH] Fix ICE in distribute_notes (PR bootstrap/51796)

2012-01-10 Thread Jakub Jelinek
Hi! My recent patch which adds REG_ARGS_SIZE note to all !ACCUMULATE_OUTGOING_ARGS noreturn calls introduced a regression, the checking code in distribute_notes can ICE if something is combned with the noreturn call and the noreturn call has the same REG_ARGS_SIZE value as before. Fixed thusly, bo