aboutsummaryrefslogtreecommitdiff
path: root/gcc/recog.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2002-08-14 10:04:51 +0000
committerUlrich Weigand <uweigand@gcc.gnu.org>2002-08-14 10:04:51 +0000
commitccfc6cc8fa5ab66c0e2dede177aa5b1010523ffc (patch)
treef8955f2da7788407bd35a092c0a414ccd029de11 /gcc/recog.c
parent72c41e5adc70750cee23e185d6cbadb3950a5b2d (diff)
downloadgcc-ccfc6cc8fa5ab66c0e2dede177aa5b1010523ffc.zip
gcc-ccfc6cc8fa5ab66c0e2dede177aa5b1010523ffc.tar.gz
gcc-ccfc6cc8fa5ab66c0e2dede177aa5b1010523ffc.tar.bz2
reload.c (find_reloads): Handle constraint letters marked by EXTRA_ADDRESS_CONSTRAINT and...
* reload.c (find_reloads): Handle constraint letters marked by EXTRA_ADDRESS_CONSTRAINT and EXTRA_MEMORY_CONSTRAINT. (alternative_allows_memconst): Likewise. * reload1.c (maybe_fix_stack_asms): Likewise. * recog.c (asm_operand_ok, preprocess_constraints, constrain_operands): Likewise. * regclass.c (record_operand_costs, record_reg_classes): Likewise. * local-alloc.c (block_alloc, requires_inout): Likewise. * stmt.c (parse_output_constraint, parse_input_constraint): Likewise. * defaults.h (EXTRA_MEMORY_CONSTRAINT): Provide a default. (EXTRA_ADDRESS_CONSTRAINT): Likewise. * doc/tm.texi: Document these two new target macros. * config/s390/s390.c (s390_expand_plus_operand): Accept already valid operands. (q_constraint): New function. config/s390/s390-protos.h (q_constraint): Declare it. config/s390/s390.h (EXTRA_CONSTRAINT): Use it. (EXTRA_MEMORY_CONSTRAINT): New macro. * config/s390/s390.md: Throughout the machine description, replace all instances of the constraint combinations 'Qo' or 'oQ' with simply 'Q'. From-SVN: r56291
Diffstat (limited to 'gcc/recog.c')
-rw-r--r--gcc/recog.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/gcc/recog.c b/gcc/recog.c
index c56069a..6bb8670 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -1848,6 +1848,18 @@ asm_operand_ok (op, constraint)
#ifdef EXTRA_CONSTRAINT
if (EXTRA_CONSTRAINT (op, c))
return 1;
+ if (EXTRA_MEMORY_CONSTRAINT (c))
+ {
+ /* Every memory operand can be reloaded to fit. */
+ if (memory_operand (op, VOIDmode))
+ return 1;
+ }
+ if (EXTRA_ADDRESS_CONSTRAINT (c))
+ {
+ /* Every address operand can be reloaded to fit. */
+ if (address_operand (op, VOIDmode))
+ return 1;
+ }
#endif
break;
}
@@ -2287,6 +2299,19 @@ preprocess_constraints ()
break;
default:
+ if (EXTRA_MEMORY_CONSTRAINT (c))
+ {
+ op_alt[j].memory_ok = 1;
+ break;
+ }
+ if (EXTRA_ADDRESS_CONSTRAINT (c))
+ {
+ op_alt[j].is_address = 1;
+ op_alt[j].class = reg_class_subunion[(int) op_alt[j].class]
+ [(int) MODE_BASE_REG_CLASS (VOIDmode)];
+ break;
+ }
+
op_alt[j].class = reg_class_subunion[(int) op_alt[j].class][(int) REG_CLASS_FROM_LETTER ((unsigned char) c)];
break;
}
@@ -2600,6 +2625,28 @@ constrain_operands (strict)
#ifdef EXTRA_CONSTRAINT
else if (EXTRA_CONSTRAINT (op, c))
win = 1;
+
+ if (EXTRA_MEMORY_CONSTRAINT (c))
+ {
+ /* Every memory operand can be reloaded to fit,
+ so copy the condition from the 'm' case. */
+ if (GET_CODE (op) == MEM
+ /* Before reload, accept what reload can turn into mem. */
+ || (strict < 0 && CONSTANT_P (op))
+ /* During reload, accept a pseudo */
+ || (reload_in_progress && GET_CODE (op) == REG
+ && REGNO (op) >= FIRST_PSEUDO_REGISTER))
+ win = 1;
+ }
+ if (EXTRA_ADDRESS_CONSTRAINT (c))
+ {
+ /* Every address operand can be reloaded to fit,
+ so copy the condition from the 'p' case. */
+ if (strict <= 0
+ || (strict_memory_address_p (recog_data.operand_mode[opno],
+ op)))
+ win = 1;
+ }
#endif
break;
}