From: Segher Boessenkool Date: Wed, 10 Dec 2014 18:28:57 +0000 (+0100) Subject: re PR target/64180 (PowerPC carry bit improvements) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7b7817713f7bd37c78b9c0bd5747579aa80f6245;p=gcc.git re PR target/64180 (PowerPC carry bit improvements) PR target/64180 * config/rs6000/rs6000.c (TARGET_MD_ASM_CLOBBERS): Define. (rs6000_md_asm_clobbers): New function. From-SVN: r218589 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7073979f8ca..2d4a8f99d78 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-12-10 Segher Boessenkool + + PR target/64180 + * config/rs6000/rs6000.c (TARGET_MD_ASM_CLOBBERS): Define. + (rs6000_md_asm_clobbers): New function. + 2014-12-10 Felix Yang * config/aarch64/aarch64-protos.h (aarch64_function_profiler): Remove diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index be092a64eb9..1c2070bd305 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -1556,6 +1556,9 @@ static const struct attribute_spec rs6000_attribute_table[] = #undef TARGET_ASM_LOOP_ALIGN_MAX_SKIP #define TARGET_ASM_LOOP_ALIGN_MAX_SKIP rs6000_loop_align_max_skip +#undef TARGET_MD_ASM_CLOBBERS +#define TARGET_MD_ASM_CLOBBERS rs6000_md_asm_clobbers + #undef TARGET_OPTION_OVERRIDE #define TARGET_OPTION_OVERRIDE rs6000_option_override @@ -3146,6 +3149,19 @@ rs6000_builtin_mask_calculate (void) | ((TARGET_LONG_DOUBLE_128) ? RS6000_BTM_LDBL128 : 0)); } +/* Implement TARGET_MD_ASM_CLOBBERS. All asm statements are considered + to clobber the XER[CA] bit because clobbering that bit without telling + the compiler worked just fine with versions of GCC before GCC 5, and + breaking a lot of older code in ways that are hard to track down is + not such a great idea. */ + +static tree +rs6000_md_asm_clobbers (tree, tree, tree clobbers) +{ + tree s = build_string (strlen (reg_names[CA_REGNO]), reg_names[CA_REGNO]); + return tree_cons (NULL_TREE, s, clobbers); +} + /* Override command line options. Mostly we process the processor type and sometimes adjust other TARGET_ options. */