[PR97870] LRA: don't remove asm goto, just nullify it.
authorVladimir N. Makarov <vmakarov@redhat.com>
Wed, 18 Nov 2020 15:07:56 +0000 (10:07 -0500)
committerVladimir N. Makarov <vmakarov@redhat.com>
Wed, 18 Nov 2020 15:11:33 +0000 (10:11 -0500)
gcc/

2020-11-18  Vladimir Makarov  <vmakarov@redhat.com>

PR target/97870
* lra-constraints.c (curr_insn_transform): Do not delete asm goto
with wrong constraints.  Nullify it saving CFG.

gcc/lra-constraints.c

index f034c7749e9b8245dc4f6ce4e891ffd75248e8f9..80ca1e06e3108f8a90ecbbac95456a3435a31b37 100644 (file)
@@ -4104,9 +4104,18 @@ curr_insn_transform (bool check_only_p)
       error_for_asm (curr_insn,
                     "inconsistent operand constraints in an %<asm%>");
       lra_asm_error_p = true;
-      /* Avoid further trouble with this insn.  Don't generate use
-        pattern here as we could use the insn SP offset.  */
-      lra_set_insn_deleted (curr_insn);
+      if (! JUMP_P (curr_insn))
+       {
+         /* Avoid further trouble with this insn.  Don't generate use
+            pattern here as we could use the insn SP offset.  */
+         lra_set_insn_deleted (curr_insn);
+       }
+      else
+       {
+         lra_invalidate_insn_data (curr_insn);
+         ira_nullify_asm_goto (curr_insn);
+         lra_update_insn_regno_info (curr_insn);
+       }
       return true;
     }