diff options
author | amylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-01-09 17:28:49 +0000 |
---|---|---|
committer | amylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-01-09 17:28:49 +0000 |
commit | 48ea55773270391b07804f5d6b4dfb28b7b3bd3f (patch) | |
tree | 71e3146782ec281fdcd5e689d1f1cbbe5f3c2286 /gcc/local-alloc.c | |
parent | f35a3d21a719693dc824d933f7e8ce2d1245addf (diff) | |
download | gcc-48ea55773270391b07804f5d6b4dfb28b7b3bd3f.tar.gz |
* defaults.h (EXTRA_MEMORY_CONSTRAINT): Add STR argument.
(EXTRA_ADDRESS_CONSTRAINT): Likewise.
(CONSTRAINT_LEN): Provide default definition.
(CONST_OK_FOR_CONSTRAINT_P): Likewise.
(CONST_DOUBLE_OK_FOR_CONSTRAINT_P): Likewise.
(EXTRA_CONSTRAINT_STR): Likewise.
(REG_CLASS_FROM_CONSTRAINT): Define.
* genoutput.c (check_constraint_len, constraint_len): New functions.
(validate_insn_alternatives): Check CONSTRAINT_LEN for each
constraint / modifier.
(gen_insn): Call check_constraint_len.
* local-alloc.c (block_alloc): Update to use new macros / pass
second argument to EXTRA_{MEMORY,ADDRESS}_CONSTRAINT.
* ra-build.c (handle_asm_insn): Likewise.
* recog.c (asm_operand_ok, preprocess_constraints): Likewise.
(constrain_operands, peep2_find_free_register): Likewise.
* regclass.c (record_operand_costs, record_reg_classes): Likewise.
* regmove.c (find_matches): Likewise.
* reload.c (push_secondary_reload, find_reloads): Likewise.
(alternative_allows_memconst): Likewise.
* reload1.c (maybe_fix_stack_asms): Likewise.
(reload_cse_simplify_operands): Likewise.
* stmt.c (parse_output_constraint, parse_input_constraint): Likewise.
* doc/tm.texi (CONSTRAINT_LEN, REG_CLASS_FROM_CONSTRAINT): Document.
(CONST_OK_FOR_CONSTRAINT_P): Likewise.
(CONST_DOUBLE_OK_FOR_CONSTRAINT_P, EXTRA_CONSTRAINT_STR): Likewise.
(EXTRA_MEMORY_CONSTRAINT, EXTRA_ADDRESS_CONSTRAINT): Add STR argument.
* config/s390/s390.h (EXTRA_MEMORY_CONSTRAINT): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61119 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/local-alloc.c')
-rw-r--r-- | gcc/local-alloc.c | 83 |
1 files changed, 45 insertions, 38 deletions
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c index 7f07be6c144..ff252a3c664 100644 --- a/gcc/local-alloc.c +++ b/gcc/local-alloc.c @@ -1338,7 +1338,8 @@ block_alloc (b) There may be more than one register, but we only try one of them. */ if (recog_data.constraints[i][0] == 'p' - || EXTRA_ADDRESS_CONSTRAINT (recog_data.constraints[i][0])) + || EXTRA_ADDRESS_CONSTRAINT (recog_data.constraints[i][0], + recog_data.constraints[i])) while (GET_CODE (r1) == PLUS || GET_CODE (r1) == MULT) r1 = XEXP (r1, 0); @@ -2424,50 +2425,56 @@ requires_inout (p) int found_zero = 0; int reg_allowed = 0; int num_matching_alts = 0; + int len; - while ((c = *p++)) - switch (c) - { - case '=': case '+': case '?': - case '#': case '&': case '!': - case '*': case '%': - case 'm': case '<': case '>': case 'V': case 'o': - case 'E': case 'F': case 'G': case 'H': - case 's': case 'i': case 'n': - case 'I': case 'J': case 'K': case 'L': - case 'M': case 'N': case 'O': case 'P': - case 'X': - /* These don't say anything we care about. */ - break; + for ( ; c = *p; p += len) + { + len = CONSTRAINT_LEN (c, p); + switch (c) + { + case '=': case '+': case '?': + case '#': case '&': case '!': + case '*': case '%': + case 'm': case '<': case '>': case 'V': case 'o': + case 'E': case 'F': case 'G': case 'H': + case 's': case 'i': case 'n': + case 'I': case 'J': case 'K': case 'L': + case 'M': case 'N': case 'O': case 'P': + case 'X': + /* These don't say anything we care about. */ + break; - case ',': - if (found_zero && ! reg_allowed) - num_matching_alts++; + case ',': + if (found_zero && ! reg_allowed) + num_matching_alts++; - found_zero = reg_allowed = 0; - break; + found_zero = reg_allowed = 0; + break; - case '0': - found_zero = 1; - break; + case '0': + found_zero = 1; + break; - case '1': case '2': case '3': case '4': case '5': - case '6': case '7': case '8': case '9': - /* Skip the balance of the matching constraint. */ - while (ISDIGIT (*p)) - p++; - break; + case '1': case '2': case '3': case '4': case '5': + case '6': case '7': case '8': case '9': + /* Skip the balance of the matching constraint. */ + do + p++; + while (ISDIGIT (*p)); + len = 0; + break; - default: - if (REG_CLASS_FROM_LETTER (c) == NO_REGS - && !EXTRA_ADDRESS_CONSTRAINT (c)) + default: + if (REG_CLASS_FROM_CONSTRAINT (c, p) == NO_REGS + && !EXTRA_ADDRESS_CONSTRAINT (c, p)) + break; + /* FALLTHRU */ + case 'p': + case 'g': case 'r': + reg_allowed = 1; break; - /* FALLTHRU */ - case 'p': - case 'g': case 'r': - reg_allowed = 1; - break; - } + } + } if (found_zero && ! reg_allowed) num_matching_alts++; |