From 5435398d80bca0b21cfb6717155b39fb65d38085 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 8 Aug 2016 15:58:46 +0200 Subject: [PATCH] re PR rtl-optimization/72821 (RTL check: expected elt 2 type 'B', have '0' (rtx barrier) in BLOCK_FOR_INSN, at rtl.h:1424) PR rtl-optimization/72821 * lra-spills.c (regno_in_use_p): Don't use BLOCK_FOR_INSN on barriers, just return false for them. From-SVN: r239241 --- gcc/ChangeLog | 6 ++++++ gcc/lra-spills.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 66e4049915b..1e9e56cae70 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-08-08 Jakub Jelinek + + PR rtl-optimization/72821 + * lra-spills.c (regno_in_use_p): Don't use BLOCK_FOR_INSN on barriers, + just return false for them. + 2016-08-08 Alan Modra PR target/72771 diff --git a/gcc/lra-spills.c b/gcc/lra-spills.c index d7529ea371f..768ae82f772 100644 --- a/gcc/lra-spills.c +++ b/gcc/lra-spills.c @@ -697,9 +697,10 @@ regno_in_use_p (rtx_insn *insn, unsigned int regno) int i, arg_regno; basic_block bb = BLOCK_FOR_INSN (insn); - while ((insn = next_nondebug_insn (insn)) != NULL_RTX - && bb == BLOCK_FOR_INSN (insn)) + while ((insn = next_nondebug_insn (insn)) != NULL_RTX) { + if (BARRIER_P (insn) || bb != BLOCK_FOR_INSN (insn)) + return false; if (! INSN_P (insn)) continue; if (GET_CODE (PATTERN (insn)) == USE -- 2.30.2