]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR inline-asm/4823 (gcc reports internal compiler error on legal code)
authorRichard Henderson <rth@redhat.com>
Thu, 12 Jun 2003 18:01:26 +0000 (11:01 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 12 Jun 2003 18:01:26 +0000 (11:01 -0700)
        PR inline-asm/4823
        * reg-stack.c (any_malformed_asm): New.
        (check_asm_stack_operands): Set it.
        (convert_regs_1): Check it before aborting.

From-SVN: r67845

gcc/ChangeLog
gcc/reg-stack.c

index 034412d1f823439f62ce25e996a26d9afaac1ae6..d5f538614ef78099e846149410481762d16f389a 100644 (file)
@@ -1,3 +1,10 @@
+2003-06-10  Richard Henderson  <rth@redhat.com>
+
+        PR inline-asm/4823
+        * reg-stack.c (any_malformed_asm): New.
+        (check_asm_stack_operands): Set it.
+        (convert_regs_1): Check it before aborting.
+
 2003-06-12  Aldy Hernandez  <aldyh@redhat.com>
 
         * config/rs6000/spe.md: Change all clobbers of the accumulator to sets.
index 75a59e687275ad3fb0414ba094ea1e7315965439..6efea36d6dc9fbb53bcdde63c1048c53289c6b60 100644 (file)
@@ -591,6 +591,9 @@ get_true_reg (pat)
       }
 }
 \f
+/* Set if we find any malformed asms in a block.  */
+static bool any_malformed_asm;
+
 /* There are many rules that an asm statement for stack-like regs must
    follow.  Those rules are explained at the top of this file: the rule
    numbers below refer to that explanation.  */
@@ -772,6 +775,7 @@ check_asm_stack_operands (insn)
     {
       /* Avoid further trouble with this insn.  */
       PATTERN (insn) = gen_rtx_USE (VOIDmode, const0_rtx);
+      any_malformed_asm = true;
       return 0;
     }
 
@@ -2692,6 +2696,7 @@ convert_regs_1 (file, block)
   edge e, beste = NULL;
 
   inserted = 0;
+  any_malformed_asm = false;
 
   /* Find the edge we will copy stack from.  It should be the most frequent
      one as it will get cheapest after compensation code is generated,
@@ -2805,9 +2810,12 @@ convert_regs_1 (file, block)
        }
     }
 
-  /* Something failed if the stack lives don't match.  */
+  /* Something failed if the stack lives don't match.  If we had malformed
+     asms, we zapped the instruction itself, but that didn't produce the
+     same pattern of register kills as before.  */
   GO_IF_HARD_REG_EQUAL (regstack.reg_set, bi->out_reg_set, win);
-  abort ();
+  if (!any_malformed_asm)
+    abort ();
  win:
   bi->stack_out = regstack;