diff options
author | Geoffrey Keating <geoffk@apple.com> | 2004-01-08 21:51:56 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@gcc.gnu.org> | 2004-01-08 21:51:56 +0000 |
commit | a29077daa7c28916ddbf4d4f7cb5721a3d1365ea (patch) | |
tree | 6196ccab96254b8d8d28326262d0aefb0362a1de | |
parent | 06fe3d7df20f8da489987f23d298fae98fd6194c (diff) | |
download | gcc-a29077daa7c28916ddbf4d4f7cb5721a3d1365ea.zip gcc-a29077daa7c28916ddbf4d4f7cb5721a3d1365ea.tar.gz gcc-a29077daa7c28916ddbf4d4f7cb5721a3d1365ea.tar.bz2 |
rs6000.c (legitimate_lo_sum_address_p): lo_sum addresses are legitimate on Darwin even when flag_pic.
* config/rs6000/rs6000.c (legitimate_lo_sum_address_p): lo_sum
addresses are legitimate on Darwin even when flag_pic.
(rs6000_legitimize_reload_address) [TARGET_MACHO]: Don't create
non-offsettable addresses for loads of TFmode constants.
From-SVN: r75558
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 48 |
2 files changed, 28 insertions, 27 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a413b38..6fa7025 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-01-08 Geoffrey Keating <geoffk@apple.com> + + * config/rs6000/rs6000.c (legitimate_lo_sum_address_p): lo_sum + addresses are legitimate on Darwin even when flag_pic. + (rs6000_legitimize_reload_address) [TARGET_MACHO]: Don't create + non-offsettable addresses for loads of TFmode constants. + 2004-01-08 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com> * config/m32r/m32r.h (ASM_OUTPUT_ALIGNED_BSS): Actually emit diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 32f4f2d..3887462 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -2565,7 +2565,7 @@ legitimate_lo_sum_address_p (enum machine_mode mode, rtx x, int strict) if (TARGET_ELF || TARGET_MACHO) { - if (DEFAULT_ABI != ABI_AIX && flag_pic) + if (DEFAULT_ABI != ABI_AIX && DEFAULT_ABI != ABI_DARWIN && flag_pic) return false; if (TARGET_TOC) return false; @@ -3056,36 +3056,30 @@ rs6000_legitimize_reload_address (rtx x, enum machine_mode mode, if (GET_CODE (x) == SYMBOL_REF && DEFAULT_ABI == ABI_DARWIN && !ALTIVEC_VECTOR_MODE (mode) - && flag_pic) - { - /* Darwin load of floating point constant. */ - rtx offset = gen_rtx (CONST, Pmode, - gen_rtx (MINUS, Pmode, x, - gen_rtx (SYMBOL_REF, Pmode, - machopic_function_base_name ()))); - x = gen_rtx (LO_SUM, GET_MODE (x), - gen_rtx (PLUS, Pmode, pic_offset_table_rtx, - gen_rtx (HIGH, Pmode, offset)), offset); + && (flag_pic || MACHO_DYNAMIC_NO_PIC_P) + /* Don't do this for TFmode, since the result isn't offsettable. */ + && mode != TFmode) + { + if (flag_pic) + { + rtx offset = gen_rtx_CONST (Pmode, + gen_rtx_MINUS (Pmode, x, + gen_rtx_SYMBOL_REF (Pmode, + machopic_function_base_name ()))); + x = gen_rtx_LO_SUM (GET_MODE (x), + gen_rtx_PLUS (Pmode, pic_offset_table_rtx, + gen_rtx_HIGH (Pmode, offset)), offset); + } + else + x = gen_rtx_LO_SUM (GET_MODE (x), + gen_rtx_HIGH (Pmode, x), x); + push_reload (XEXP (x, 0), NULL_RTX, &XEXP (x, 0), NULL, - BASE_REG_CLASS, Pmode, VOIDmode, 0, 0, - opnum, (enum reload_type)type); + BASE_REG_CLASS, Pmode, VOIDmode, 0, 0, + opnum, (enum reload_type)type); *win = 1; return x; } - if (GET_CODE (x) == SYMBOL_REF - && DEFAULT_ABI == ABI_DARWIN - && !ALTIVEC_VECTOR_MODE (mode) - && MACHO_DYNAMIC_NO_PIC_P) - { - /* Darwin load of floating point constant. */ - x = gen_rtx (LO_SUM, GET_MODE (x), - gen_rtx (HIGH, Pmode, x), x); - push_reload (XEXP (x, 0), NULL_RTX, &XEXP (x, 0), NULL, - BASE_REG_CLASS, Pmode, VOIDmode, 0, 0, - opnum, (enum reload_type)type); - *win = 1; - return x; - } #endif if (TARGET_TOC && constant_pool_expr_p (x) |