[nvptx] Fix prevent_branch_around_nothing
2018-03-20 Tom de Vries <tom@codesourcery.com>
PR target/84954
* config/nvptx/nvptx.c (prevent_branch_around_nothing): Also update
seen_label if seen_label is already set.
---
gcc/config/nvptx/nvptx.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
@@ -4419,14 +4419,15 @@ prevent_branch_around_nothing (void)
rtx_insn *seen_label = NULL;
for (rtx_insn *insn = get_insns (); insn; insn = NEXT_INSN (insn))
{
- if (seen_label == NULL)
+ if (INSN_P (insn) && condjump_p (insn))
{
- if (INSN_P (insn) && condjump_p (insn))
- seen_label = label_ref_label (nvptx_condjump_label (insn, false));
-
+ seen_label = label_ref_label (nvptx_condjump_label (insn, false));
continue;
}
+ if (seen_label == NULL)
+ continue;
+
if (NOTE_P (insn) || DEBUG_INSN_P (insn))
continue;