Re: resent2 [PATCH] Fix ICE in redirect_jump, at jump.c:1497 PR50496

2011-11-23 Thread Chung-Lin Tang
On 2011/11/2 11:47 PM, Bernd Schmidt wrote: On 10/31/11 10:11, Eric Botcazou wrote: I'm suggesting a new patch, as attached. Before reload_completed, we directly return 0 upon nlabel == NULL, which should be identical with old behavior, while asserting fail if after reload (where we assume the

Re: resent2 [PATCH] Fix ICE in redirect_jump, at jump.c:1497 PR50496

2011-11-02 Thread Bernd Schmidt
On 10/31/11 10:11, Eric Botcazou wrote: I'm suggesting a new patch, as attached. Before reload_completed, we directly return 0 upon nlabel == NULL, which should be identical with old behavior, while asserting fail if after reload (where we assume the simple_return/return distinction is

Re: resent2 [PATCH] Fix ICE in redirect_jump, at jump.c:1497 PR50496

2011-10-31 Thread Chung-Lin Tang
On 2011/10/25 02:04 AM, Bernd Schmidt wrote: On 10/24/11 20:02, Chung-Lin Tang wrote: On 2011/10/18 04:03 PM, Eric Botcazou wrote: thread_prologue_and_epilogue_insns should detect all cases where a return insn can be created. So any CFG cleanup that runs before it does not need this

Re: resent2 [PATCH] Fix ICE in redirect_jump, at jump.c:1497 PR50496

2011-10-31 Thread Eric Botcazou
I'm suggesting a new patch, as attached. Before reload_completed, we directly return 0 upon nlabel == NULL, which should be identical with old behavior, while asserting fail if after reload (where we assume the simple_return/return distinction is required). This should ensure better that, if

Re: resent2 [PATCH] Fix ICE in redirect_jump, at jump.c:1497 PR50496

2011-10-24 Thread Chung-Lin Tang
On 2011/10/18 04:03 PM, Eric Botcazou wrote: thread_prologue_and_epilogue_insns should detect all cases where a return insn can be created. So any CFG cleanup that runs before it does not need this functionality. So we're left with CFG cleanups that run after it and could forward edges to

Re: resent2 [PATCH] Fix ICE in redirect_jump, at jump.c:1497 PR50496

2011-10-24 Thread Bernd Schmidt
On 10/24/11 20:02, Chung-Lin Tang wrote: On 2011/10/18 04:03 PM, Eric Botcazou wrote: thread_prologue_and_epilogue_insns should detect all cases where a return insn can be created. So any CFG cleanup that runs before it does not need this functionality. So we're left with CFG cleanups that

Re: resent2 [PATCH] Fix ICE in redirect_jump, at jump.c:1497 PR50496

2011-10-18 Thread Eric Botcazou
thread_prologue_and_epilogue_insns should detect all cases where a return insn can be created. So any CFG cleanup that runs before it does not need this functionality. So we're left with CFG cleanups that run after it and could forward edges to an edge from a return insn to the exit block in

Re: resent2 [PATCH] Fix ICE in redirect_jump, at jump.c:1497 PR50496

2011-10-17 Thread Bernd Schmidt
On 10/15/11 16:21, Eric Botcazou wrote: so the correct fix is very likely something like: Index: cfgrtl.c === --- cfgrtl.c(revision 179844) +++ cfgrtl.c(working copy) @@ -1024,13 +1024,20 @@ patch_jump_insn (rtx insn,

Re: resent2 [PATCH] Fix ICE in redirect_jump, at jump.c:1497 PR50496

2011-10-17 Thread Bernd Schmidt
On 10/15/11 16:21, Eric Botcazou wrote: PR middle-end/50496 * cfgrtl.c (try_redirect_by_replacing_jump): Treat EXIT_BLOCK_PTR case separately before call to redirect_jump(). Add assertion. (patch_jump_insn): Same. This will definitely disable redirections to the exit

Re: resent2 [PATCH] Fix ICE in redirect_jump, at jump.c:1497 PR50496

2011-10-17 Thread Eric Botcazou
Yes. However, in the case that caused the PR, this was attempted with reload_completed == 0, so we cannot generate return patterns anyway and must fail. OK, but we clean up the CFG after reload is completed (e.g. just before emitting the prologue) so in this case we can generate return

Re: resent2 [PATCH] Fix ICE in redirect_jump, at jump.c:1497 PR50496

2011-10-17 Thread Bernd Schmidt
On 10/17/11 19:43, Eric Botcazou wrote: Yes. However, in the case that caused the PR, this was attempted with reload_completed == 0, so we cannot generate return patterns anyway and must fail. OK, but we clean up the CFG after reload is completed (e.g. just before emitting the prologue) so

Re: resent2 [PATCH] Fix ICE in redirect_jump, at jump.c:1497 PR50496

2011-10-14 Thread Markus Trippelsdorf
Consider this testcase: $ cat test.cpp class GCAlloc { }; class BaseAlloc { }; class String; class Base { public: virtual void destroy( String *str ) const =0; }; class String: public GCAlloc { const Base *m_class; public: enum constants { }; String( const char *data );