diff options
author | Andreas Krebbel <Andreas.Krebbel@de.ibm.com> | 2011-03-24 16:38:24 +0000 |
---|---|---|
committer | Andreas Krebbel <krebbel@gcc.gnu.org> | 2011-03-24 16:38:24 +0000 |
commit | 212aa74f9e5e721be3baa109d247588f393d3927 (patch) | |
tree | c6909ce6aa98f3b0852a852a2ee5d3b4a8fd0416 /gcc/config/s390 | |
parent | bf3b3396ef74a4993fdcdb325503f982541885d9 (diff) | |
download | gcc-212aa74f9e5e721be3baa109d247588f393d3927.zip gcc-212aa74f9e5e721be3baa109d247588f393d3927.tar.gz gcc-212aa74f9e5e721be3baa109d247588f393d3927.tar.bz2 |
s390.c (s390_preferred_reload_class): Return NO_REGS for invalid symbolic addresses.
2011-03-24 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* config/s390/s390.c (s390_preferred_reload_class): Return NO_REGS
for invalid symbolic addresses.
(s390_secondary_reload): Don't use s390_check_symref_alignment for
larl operands.
From-SVN: r171405
Diffstat (limited to 'gcc/config/s390')
-rw-r--r-- | gcc/config/s390/s390.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 2a299c2..7e84ff1 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -2974,12 +2974,16 @@ s390_preferred_reload_class (rtx op, reg_class_t rclass) it is most likely being used as an address, so prefer ADDR_REGS. If 'class' is not a superset of ADDR_REGS, e.g. FP_REGS, reject this reload. */ - case PLUS: case LABEL_REF: case SYMBOL_REF: case CONST: + if (!legitimate_reload_constant_p (op)) + return NO_REGS; + /* fallthrough */ + case PLUS: + /* load address will be used. */ if (reg_class_subset_p (ADDR_REGS, rclass)) - return ADDR_REGS; + return ADDR_REGS; else return NO_REGS; @@ -3097,12 +3101,16 @@ s390_secondary_reload (bool in_p, rtx x, reg_class_t rclass_i, if (TARGET_Z10) { + HOST_WIDE_INT offset; + rtx symref; + /* On z10 several optimizer steps may generate larl operands with an odd addend. */ if (in_p - && s390_symref_operand_p (x, NULL, NULL) + && s390_symref_operand_p (x, &symref, &offset) && mode == Pmode - && !s390_check_symref_alignment (x, 2)) + && !SYMBOL_REF_ALIGN1_P (symref) + && (offset & 1) == 1) sri->icode = ((mode == DImode) ? CODE_FOR_reloaddi_larl_odd_addend_z10 : CODE_FOR_reloadsi_larl_odd_addend_z10); |