aboutsummaryrefslogtreecommitdiff
path: root/gcc/reg-stack.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2003-06-12 11:01:26 -0700
committerRichard Henderson <rth@gcc.gnu.org>2003-06-12 11:01:26 -0700
commitd6fc04926d67125c8de341b1bc5161ba058b555d (patch)
treea58f94157b4eb2934df8ba2261b7e46ba75ed2dc /gcc/reg-stack.c
parent79b59cc3d3896f109992cee1bbba17ee255c334d (diff)
downloadgcc-d6fc04926d67125c8de341b1bc5161ba058b555d.zip
gcc-d6fc04926d67125c8de341b1bc5161ba058b555d.tar.gz
gcc-d6fc04926d67125c8de341b1bc5161ba058b555d.tar.bz2
re PR inline-asm/4823 (gcc reports internal compiler error on legal code)
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
Diffstat (limited to 'gcc/reg-stack.c')
-rw-r--r--gcc/reg-stack.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c
index 75a59e6..6efea36 100644
--- a/gcc/reg-stack.c
+++ b/gcc/reg-stack.c
@@ -591,6 +591,9 @@ get_true_reg (pat)
}
}
+/* 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;