From 2a230e9dc40fd0a9ffe86e0548a935350dd39459 Mon Sep 17 00:00:00 2001 From: Bernd Schmidt Date: Wed, 7 Oct 1998 22:07:40 -0600 Subject: stmt.c (n_occurrences): New static function. * stmt.c (n_occurrences): New static function. (expand_asm_operands): Verify that all constrains match in the number of alternatives. Verify that '+' or '=' are at the beginning of an output constraint. Don't allow '&' for input operands. Verify that '%' isn't written for the last operand. * reload.c (find_reloads): Abort if an asm is found with invalid constraints; all possible problems ought to be checked for earlier. From-SVN: r22911 --- gcc/reload.c | 38 +++++--------------------------------- 1 file changed, 5 insertions(+), 33 deletions(-) (limited to 'gcc/reload.c') diff --git a/gcc/reload.c b/gcc/reload.c index 428ce87..32ee0f5 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -2442,15 +2442,6 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) bcopy ((char *) constraints, (char *) constraints1, noperands * sizeof (char *)); n_alternatives = n_occurrences (',', constraints[0]) + 1; - for (i = 1; i < noperands; i++) - if (n_alternatives != n_occurrences (',', constraints[i]) + 1) - { - error_for_asm (insn, "operand constraints differ in number of alternatives"); - /* Avoid further trouble with this insn. */ - PATTERN (insn) = gen_rtx_USE (VOIDmode, const0_rtx); - n_reloads = 0; - return; - } } break; } @@ -2510,15 +2501,9 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) { /* The last operand should not be marked commutative. */ if (i == noperands - 1) - { - if (this_insn_is_asm) - warning_for_asm (this_insn, - "`%%' constraint used with last operand"); - else - abort (); - } - else - commutative = i; + abort (); + + commutative = i; } else if (c >= '0' && c <= '9') { @@ -2528,13 +2513,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) /* An operand may not match itself. */ if (c == i) - { - if (this_insn_is_asm) - warning_for_asm (this_insn, - "operand %d has constraint %d", i, c); - else - abort (); - } + abort (); /* If C can be commuted with C+1, and C might need to match I, then C+1 might also need to match I. */ @@ -3372,14 +3351,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) early_data = decompose (recog_operand[i]); if (modified[i] == RELOAD_READ) - { - if (this_insn_is_asm) - warning_for_asm (this_insn, - "`&' constraint used with input operand"); - else - abort (); - continue; - } + abort (); if (this_alternative[i] == NO_REGS) { -- cgit v1.1