From c2cba7a96e04069011ae508e3027bbf128208040 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Mon, 28 Aug 2000 17:44:21 -0700 Subject: local-alloc.c (requires_inout): Don't use reserved range for EXTRA_CONSTRAINTS... * local-alloc.c (requires_inout): Don't use reserved range for EXTRA_CONSTRAINTS; use anything not matched by REG_CLASS_FROM_LETTER. * recog.c (asm_operand_ok): Likewise. (preprocess_constraints, constrain_operands): Likewise. * regclass.c (record_reg_classes): Likewise. * reload.c (find_reloads): Likewise. * reload1.c (maybe_fix_stack_asms): Likewise. (reload_cse_simplify_operands): Likewise. * stmt.c (expand_asm_operands): Likewise. * md.texi: Update constraints documentation. * tm.texi (EXTRA_CONSTRAINT): Update. From-SVN: r36023 --- gcc/stmt.c | 51 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 9 deletions(-) (limited to 'gcc/stmt.c') diff --git a/gcc/stmt.c b/gcc/stmt.c index d0dbb9e..7b27f87 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -1508,17 +1508,34 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line) break; case 'g': case 'X': -#ifdef EXTRA_CONSTRAINT - case 'Q': case 'R': case 'S': case 'T': case 'U': -#endif allows_reg = 1; allows_mem = 1; break; case 'p': case 'r': - default: allows_reg = 1; break; + + default: + if (! ISALPHA (constraint[j])) + { + error ("invalid punctuation `%c' in constraint", + constraint[j]); + return; + } + if (REG_CLASS_FROM_LETTER (constraint[j]) != NO_REGS) + allows_reg = 1; +#ifdef EXTRA_CONSTRAINT + else + { + /* Otherwise we can't assume anything about the nature of + the constraint except that it isn't purely registers. + Treat it like "g" and hope for the best. */ + allows_reg = 1; + allows_mem = 1; + } +#endif + break; } /* If an output operand is not a decl or indirect ref and our constraint @@ -1681,18 +1698,34 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line) /* ... fall through ... */ case 'p': case 'r': - default: allows_reg = 1; break; case 'g': case 'X': -#ifdef EXTRA_CONSTRAINT - case 'Q': case 'R': case 'S': case 'T': case 'U': -#endif - allows_reg = 1; allows_mem = 1; break; + + default: + if (! ISALPHA (constraint[j])) + { + error ("invalid punctuation `%c' in constraint", + constraint[j]); + return; + } + if (REG_CLASS_FROM_LETTER (constraint[j]) != NO_REGS) + allows_reg = 1; +#ifdef EXTRA_CONSTRAINT + else + { + /* Otherwise we can't assume anything about the nature of + the constraint except that it isn't purely registers. + Treat it like "g" and hope for the best. */ + allows_reg = 1; + allows_mem = 1; + } +#endif + break; } if (! allows_reg && allows_mem) -- cgit v1.1