diff options
author | Bernd Schmidt <bernds@codesourcery.com> | 2011-07-08 16:08:13 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds@gcc.gnu.org> | 2011-07-08 16:08:13 +0000 |
commit | 9ae601015839cc1835b55134bc9899c475ef77c2 (patch) | |
tree | 064ce26acb0905a2d9ba418ca486888868179baa /gcc | |
parent | 329af3c7e9317952d68d3522e9e3aa6ac188332a (diff) | |
download | gcc-9ae601015839cc1835b55134bc9899c475ef77c2.zip gcc-9ae601015839cc1835b55134bc9899c475ef77c2.tar.gz gcc-9ae601015839cc1835b55134bc9899c475ef77c2.tar.bz2 |
genattrtab.c (evaluate_eq_attr): Allow an attribute to be defined in terms of another.
* genattrtab.c (evaluate_eq_attr): Allow an attribute to be defined
in terms of another.
(write_attr_value): Write a cast if necessary.
From-SVN: r176047
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/genattrtab.c | 38 |
2 files changed, 45 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1cb2ce0..0fc7dfd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-07-08 Bernd Schmidt <bernds@codesourcery.com> + + * genattrtab.c (evaluate_eq_attr): Allow an attribute to be defined + in terms of another. + (write_attr_value): Write a cast if necessary. + 2011-07-08 Richard Guenther <rguenther@suse.de> * fold-const.c (fold_binary_loc): Remove index +p PTR -> PTR +p index @@ -19,7 +25,7 @@ overlapping when it is call to address. 2011-07-08 Georg-Johann Lay <avr@gjlay.de> - + * config/avr/avr.c (output_reload_insisf): Use 'REG_Z+1' instead of magic '31'. diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c index 4976604..e927ca2 100644 --- a/gcc/genattrtab.c +++ b/gcc/genattrtab.c @@ -1916,6 +1916,37 @@ evaluate_eq_attr (rtx exp, struct attr_desc *attr, rtx value, rtx newexp; int i; + while (GET_CODE (value) == ATTR) + { + struct attr_value *av = NULL; + + attr = find_attr (&XSTR (value, 0), 0); + + if (insn_code_values) + { + struct attr_value_list *iv; + for (iv = insn_code_values[insn_code]; iv; iv = iv->next) + if (iv->attr == attr) + { + av = iv->av; + break; + } + } + else + { + struct insn_ent *ie; + for (av = attr->first_value; av; av = av->next) + for (ie = av->first_insn; ie; ie = ie->next) + if (ie->def->insn_code == insn_code) + goto got_av; + } + if (av) + { + got_av: + value = av->value; + } + } + switch (GET_CODE (value)) { case CONST_STRING: @@ -4119,6 +4150,13 @@ write_attr_value (struct attr_desc *attr, rtx value) case ATTR: { struct attr_desc *attr2 = find_attr (&XSTR (value, 0), 0); + if (attr->enum_name) + printf ("(enum %s)", attr->enum_name); + else if (!attr->is_numeric) + printf ("(enum attr_%s)", attr->name); + else if (!attr2->is_numeric) + printf ("(int)"); + printf ("get_attr_%s (%s)", attr2->name, (attr2->is_const ? "" : "insn")); } |