diff options
author | Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com> | 2004-12-15 12:13:07 +0000 |
---|---|---|
committer | Nick Clifton <nickc@gcc.gnu.org> | 2004-12-15 12:13:07 +0000 |
commit | c331bf080274e520ae3ac9238c73625c9981dedc (patch) | |
tree | 60b06fc1a57f4dd134488d9304dfdcff69417786 /gcc/config/m32r/m32r.c | |
parent | 2594119414795e798aa0ed29617f12d0f629c56b (diff) | |
download | gcc-c331bf080274e520ae3ac9238c73625c9981dedc.zip gcc-c331bf080274e520ae3ac9238c73625c9981dedc.tar.gz gcc-c331bf080274e520ae3ac9238c73625c9981dedc.tar.bz2 |
config/m32r.c (m32r_legitimize_pic_address): Changed to support GOTOFF relocation.
config/m32r.c (m32r_legitimize_pic_address): Changed to support GOTOFF
relocation.
config/m32r.md (UNSPEC_GOTOFF): New.
(gotoff_load_addr): New.
From-SVN: r92186
Diffstat (limited to 'gcc/config/m32r/m32r.c')
-rw-r--r-- | gcc/config/m32r/m32r.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c index 384b5ae..b5a5325 100644 --- a/gcc/config/m32r/m32r.c +++ b/gcc/config/m32r/m32r.c @@ -1987,12 +1987,21 @@ m32r_legitimize_pic_address (rtx orig, rtx reg) else address = reg; + current_function_uses_pic_offset_table = 1; + + if (GET_CODE (orig) == LABEL_REF + || (GET_CODE (orig) == SYMBOL_REF && SYMBOL_REF_LOCAL_P (orig))) + { + emit_insn (gen_gotoff_load_addr (reg, orig)); + emit_insn (gen_addsi3 (reg, reg, pic_offset_table_rtx)); + return reg; + } + emit_insn (gen_pic_load_addr (address, orig)); emit_insn (gen_addsi3 (address, address, pic_offset_table_rtx)); pic_ref = gen_const_mem (Pmode, address); insn = emit_move_insn (reg, pic_ref); - current_function_uses_pic_offset_table = 1; #if 0 /* Put a REG_EQUAL note on this insn, so that it can be optimized by loop. */ |