Message ID | 4EAE6045.7070201@codesourcery.com |
---|---|
State | New |
Headers | show |
> 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 a post-prologue case of redirecting > to the exit block ever happens we will more easily know (by some future > PR :P) > > Bootstrapped and tested on i686, and cross tested on ARM using QEMU. > Eric, is this approach okay? Don't you want epilogue_completed instead of reload_completed? Otherwise, yes, the approach is fine with me, but wait for Bernd's input. > 2011-10-31 Chung-Lin Tang <cltang@codesourcery.com> > > * jump.c (redirect_jump): Assert fail on nlabel == NULL_RTX > only after reload. Add comments. Minor rewording of the comment below: + if (!nlabel) + { /* If there is no label, we are asked to redirect to the EXIT block. Now, before the epilogue is emitted, return/simple_return cannot be created so we return 0 immediately. After the epilogue is emitted, we always expect a label, either a non-null label, or a return/simple_return RTX. + if (!reload_completed) + return 0; + gcc_unreachable (); + }
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 required). >> >> This should ensure better that, if a post-prologue case of redirecting >> to the exit block ever happens we will more easily know (by some future >> PR :P) >> >> Bootstrapped and tested on i686, and cross tested on ARM using QEMU. >> Eric, is this approach okay? > > Don't you want epilogue_completed instead of reload_completed? Otherwise, > yes, the approach is fine with me, but wait for Bernd's input. That looks good to me too. Bernd
Index: jump.c =================================================================== --- jump.c (revision 180421) +++ jump.c (working copy) @@ -1495,8 +1495,19 @@ redirect_jump (rtx jump, rtx nlabel, int delete_un { rtx olabel = JUMP_LABEL (jump); - gcc_assert (nlabel != NULL_RTX); + if (!nlabel) + { + /* For nlabel == NULL_RTX cases, if reload_completed == 0, + return/simple_return are not yet creatable, thus we return 0 + immediately; if reload_completed, we do not accept !nlabel + at all, either a non-null label, or return/simple_return RTX. + In that case assert fail. */ + if (!reload_completed) + return 0; + gcc_unreachable (); + } + if (nlabel == olabel) return 1;