From: jakub Date: Mon, 7 Jul 2003 20:53:44 +0000 (+0000) Subject: * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Remove bogus X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a50375b8eb240bba021666e5d10a9d70fd94bad9;p=thirdparty%2Fgcc.git * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Remove bogus clearing of SYMBOL_FLAG_LOCAL bit. If vcall_offset fits into signed 16-bit immediate, use one instruction for both addition and load. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69055 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c874fd6da303..ae1c379076b0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2003-07-07 Jakub Jelinek + + * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Remove bogus + clearing of SYMBOL_FLAG_LOCAL bit. + If vcall_offset fits into signed 16-bit immediate, use + one instruction for both addition and load. + 2003-07-07 Neil Booth * opts.c (common_handle_option): Correct handling of the diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 13f3fc3320c2..f3b6c30b836f 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -12374,10 +12374,19 @@ rs6000_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function) rtx tmp = gen_rtx_REG (Pmode, 12); emit_move_insn (tmp, gen_rtx_MEM (Pmode, this)); - emit_insn (TARGET_32BIT - ? gen_addsi3 (tmp, tmp, vcall_offset_rtx) - : gen_adddi3 (tmp, tmp, vcall_offset_rtx)); - emit_move_insn (tmp, gen_rtx_MEM (Pmode, tmp)); + if (((unsigned HOST_WIDE_INT) vcall_offset) + 0x8000 >= 0x10000) + { + emit_insn (TARGET_32BIT + ? gen_addsi3 (tmp, tmp, vcall_offset_rtx) + : gen_adddi3 (tmp, tmp, vcall_offset_rtx)); + emit_move_insn (tmp, gen_rtx_MEM (Pmode, tmp)); + } + else + { + rtx loc = gen_rtx_PLUS (Pmode, tmp, vcall_offset_rtx); + + emit_move_insn (tmp, gen_rtx_MEM (Pmode, loc)); + } emit_insn (TARGET_32BIT ? gen_addsi3 (this, this, tmp) : gen_adddi3 (this, this, tmp)); @@ -12390,7 +12399,6 @@ rs6000_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function) TREE_USED (function) = 1; } funexp = XEXP (DECL_RTL (function), 0); - SYMBOL_REF_FLAGS (funexp) &= ~SYMBOL_FLAG_LOCAL; funexp = gen_rtx_MEM (FUNCTION_MODE, funexp); #if TARGET_MACHO