diff options
author | krebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-27 11:46:45 +0000 |
---|---|---|
committer | krebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-27 11:46:45 +0000 |
commit | 39a1a66f5e30580edaa3550668222db2ef09e543 (patch) | |
tree | 8b144af648d4119d5962a025331d5ae887135564 /gcc/reload.c | |
parent | e9ff93b1e1540dfd1f609a92dfa66c27c673abfa (diff) | |
download | gcc-39a1a66f5e30580edaa3550668222db2ef09e543.tar.gz |
2008-05-27 Andreas Krebbel <krebbel1@de.ibm.com>
* reload.c: (find_reloads): Skip alternatives according to the
"enabled" attribute. Constify the constraint variable.
* recog.c (get_attr_enabled): Add default implementation.
(extract_insn): Set the alternative_enabled_p array
in the recog_data struct.
(preprocess_constraints, constrain_operands): Skip
alternatives according to the "enabled" attribute
* recog.h (struct recog_data): New field alternative_enabled_p.
(skip_alternative): New inline function.
* regclass.c: (record_operand_costs): Check the "enabled"
attribute.
(record_reg_classes): Skip alternative according to the
"enabled" attribute.
* doc/md.texi: Add documention for the "enabled" attribute.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@136012 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/reload.c')
-rw-r--r-- | gcc/reload.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/gcc/reload.c b/gcc/reload.c index b6880ea7bc9..7472272d9c4 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -2523,7 +2523,7 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known, int noperands; /* These start out as the constraints for the insn and they are chewed up as we consider alternatives. */ - char *constraints[MAX_RECOG_OPERANDS]; + const char *constraints[MAX_RECOG_OPERANDS]; /* These are the preferred classes for an operand, or NO_REGS if it isn't a register. */ enum reg_class preferred_class[MAX_RECOG_OPERANDS]; @@ -2630,7 +2630,8 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known, memcpy (operand_mode, recog_data.operand_mode, noperands * sizeof (enum machine_mode)); - memcpy (constraints, recog_data.constraints, noperands * sizeof (char *)); + memcpy (constraints, recog_data.constraints, + noperands * sizeof (const char *)); commutative = -1; @@ -2641,8 +2642,9 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known, for (i = 0; i < noperands; i++) { - char *p; + const char *p; int c; + char *end; substed_operand[i] = recog_data.operand[i]; p = constraints[i]; @@ -2686,7 +2688,8 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known, case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { - c = strtoul (p - 1, &p, 10); + c = strtoul (p - 1, &end, 10); + p = end; operands_match[c][i] = operands_match_p (recog_data.operand[c], @@ -2914,11 +2917,21 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known, a bad register class to only count 1/3 as much. */ int reject = 0; + if (!recog_data.alternative_enabled_p[this_alternative_number]) + { + int i; + + for (i = 0; i < recog_data.n_operands; i++) + constraints[i] = skip_alternative (constraints[i]); + + continue; + } + this_earlyclobber = 0; for (i = 0; i < noperands; i++) { - char *p = constraints[i]; + const char *p = constraints[i]; char *end; int len; int win = 0; @@ -3717,7 +3730,7 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known, address_reloaded[commutative + 1] = t; memcpy (constraints, recog_data.constraints, - noperands * sizeof (char *)); + noperands * sizeof (const char *)); goto try_swapped; } else |