diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 45aea6a3409..b9402fae69d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2001-12-01 Geoff Keating + + * config/rs6000/rs6000.h (LEGITIMATE_LO_SUM_ADDRESS_P): Complex + LO_SUM addresses less than word size are not legitimate, + because they lead to invalid SUBREGs. + * config/rs6000/rs6000.c (rs6000_legitimize_address): Likewise. + 2001-12-01 Olivier Hainque * unroll.c (loop_iterations): Give up on jumps with null JUMP_LABEL diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 2f1b0a162ae..2fd7f3318d1 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -1617,6 +1617,7 @@ rs6000_legitimize_address (x, oldx, mode) else if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 0)) == REG && GET_CODE (XEXP (x, 1)) != CONST_INT + && GET_MODE_NUNITS (mode) == 1 && (TARGET_HARD_FLOAT || TARGET_POWERPC64 || mode != DFmode) && (TARGET_POWERPC64 || mode != DImode) && mode != TImode) @@ -1640,9 +1641,9 @@ rs6000_legitimize_address (x, oldx, mode) && GET_CODE (x) != CONST_INT && GET_CODE (x) != CONST_DOUBLE && CONSTANT_P (x) - && (TARGET_HARD_FLOAT || mode != DFmode) - && mode != DImode - && mode != TImode) + && GET_MODE_NUNITS (mode) == 1 + && (GET_MODE_BITSIZE (mode) <= 32 + || (TARGET_HARD_FLOAT && mode != DFmode))) { rtx reg = gen_reg_rtx (Pmode); emit_insn (gen_elf_high (reg, (x))); diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index e81069affb7..aa313c3f950 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -1975,16 +1975,15 @@ typedef struct rs6000_args #define LEGITIMATE_INDIRECT_ADDRESS_P(X, STRICT) \ (GET_CODE (X) == REG && INT_REG_OK_FOR_BASE_P (X, (STRICT))) -#define LEGITIMATE_LO_SUM_ADDRESS_P(MODE, X, STRICT) \ - (TARGET_ELF \ - && ! flag_pic && ! TARGET_TOC \ - && (MODE) != DImode \ - && (MODE) != TImode \ - && ! ALTIVEC_VECTOR_MODE (MODE) \ - && (TARGET_HARD_FLOAT || (MODE) != DFmode) \ - && GET_CODE (X) == LO_SUM \ - && GET_CODE (XEXP (X, 0)) == REG \ - && INT_REG_OK_FOR_BASE_P (XEXP (X, 0), (STRICT)) \ +#define LEGITIMATE_LO_SUM_ADDRESS_P(MODE, X, STRICT) \ + (TARGET_ELF \ + && ! flag_pic && ! TARGET_TOC \ + && GET_MODE_NUNITS (MODE) == 1 \ + && (GET_MODE_BITSIZE (MODE) <= 32 \ + || (TARGET_HARD_FLOAT && (MODE) != DFmode)) \ + && GET_CODE (X) == LO_SUM \ + && GET_CODE (XEXP (X, 0)) == REG \ + && INT_REG_OK_FOR_BASE_P (XEXP (X, 0), (STRICT)) \ && CONSTANT_P (XEXP (X, 1))) #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \