re PR rtl-optimization/72821 (RTL check: expected elt 2 type 'B', have '0' (rtx barri...
authorJakub Jelinek <jakub@redhat.com>
Mon, 8 Aug 2016 13:58:46 +0000 (15:58 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 8 Aug 2016 13:58:46 +0000 (15:58 +0200)
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
gcc/lra-spills.c

index 66e4049915b584dc38fda72cb4b99c9f607a64ec..1e9e56cae70fca14cb039b67ca771a05cf1f0001 100644 (file)
@@ -1,3 +1,9 @@
+2016-08-08  Jakub Jelinek  <jakub@redhat.com>
+
+       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  <amodra@gmail.com>
 
        PR target/72771
index d7529ea371fd4129fcba0b3475b72e60b15a0845..768ae82f772641f04571fdb25e1fbd9f365fd781 100644 (file)
@@ -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