From a730a6d92529a93f10fdced532e9064a39cd57c9 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Wed, 11 May 2016 21:11:00 +0200 Subject: [PATCH] i386.c (legitimize_pic_address): Use copy_to_suggested_reg instead of gen_movsi. * config/i386/i386.c (legitimize_pic_address): Use copy_to_suggested_reg instead of gen_movsi. From-SVN: r236138 --- gcc/ChangeLog | 5 +++++ gcc/config/i386/i386.c | 14 ++------------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 88f92359955..08e875864e4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-05-11 Uros Bizjak + + * config/i386/i386.c (legitimize_pic_address): Use + copy_to_suggested_reg instead of gen_movsi. + 2016-05-11 Michael Meissner * config/rs6000/predicates.md (quad_memory_operand): Move most of diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 9f62089b8b1..046717bae45 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -15474,8 +15474,6 @@ legitimize_pic_address (rtx orig, rtx reg) { new_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_PCREL); new_rtx = gen_rtx_CONST (Pmode, new_rtx); - - new_rtx = copy_to_suggested_reg (new_rtx, reg, Pmode); } else if (TARGET_64BIT && ix86_cmodel != CM_LARGE_PIC) { @@ -15484,14 +15482,6 @@ legitimize_pic_address (rtx orig, rtx reg) new_rtx = gen_rtx_CONST (Pmode, new_rtx); new_rtx = gen_const_mem (Pmode, new_rtx); set_mem_alias_set (new_rtx, ix86_GOT_alias_set ()); - - if (reg == 0) - reg = gen_reg_rtx (Pmode); - /* Use directly gen_movsi, otherwise the address is loaded - into register for CSE. We don't want to CSE this addresses, - instead we CSE addresses from the GOT table, so skip this. */ - emit_insn (gen_movsi (reg, new_rtx)); - new_rtx = reg; } else { @@ -15504,9 +15494,9 @@ legitimize_pic_address (rtx orig, rtx reg) new_rtx = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new_rtx); new_rtx = gen_const_mem (Pmode, new_rtx); set_mem_alias_set (new_rtx, ix86_GOT_alias_set ()); - - new_rtx = copy_to_suggested_reg (new_rtx, reg, Pmode); } + + new_rtx = copy_to_suggested_reg (new_rtx, reg, Pmode); } else { -- 2.30.2