aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei Guozhi <carrot@google.com>2010-01-27 09:19:36 +0000
committerNick Clifton <nickc@gcc.gnu.org>2010-01-27 09:19:36 +0000
commit336e24cffcbd49a3061e03a9040906ad9871ebf8 (patch)
treebcc6e68fe7d01284fc11a330418a65335c79222f
parentb4b04ed67dee0b74eaad24d08711590b4dd04d3b (diff)
downloadgcc-336e24cffcbd49a3061e03a9040906ad9871ebf8.zip
gcc-336e24cffcbd49a3061e03a9040906ad9871ebf8.tar.gz
gcc-336e24cffcbd49a3061e03a9040906ad9871ebf8.tar.bz2
re PR target/42671 (Thumb2 generate more instructions than Thumb1 to load GOT address)
PR target/42671 * config/arm/arm.c (arm_load_pic_register): Use the same code sequence with Thumb2 as for Thumb1. * config/arm/arm.md (pic_add_dot_plus_four): Enable this pattern for all Thumb varieties. From-SVN: r156276
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/arm/arm.c5
-rw-r--r--gcc/config/arm/arm.md4
3 files changed, 12 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7c976bd..16840a8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2010-01-27 Wei Guozhi <carrot@google.com>
+
+ PR target/42671
+ * config/arm/arm.c (arm_load_pic_register): Use the same code
+ sequence with Thumb2 as for Thumb1.
+ * config/arm/arm.md (pic_add_dot_plus_four): Enable this pattern
+ for all Thumb varieties.
+
2010-01-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* config/sparc/sparc.c (sparc_elf_asm_named_section): Test for
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index ffff9ab..877e9bb 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -1,6 +1,6 @@
/* Output routines for GCC for ARM.
Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl)
and Martin Simmons (@harleqn.co.uk).
@@ -5150,8 +5150,7 @@ arm_load_pic_register (unsigned long saved_regs ATTRIBUTE_UNUSED)
}
emit_insn (gen_pic_load_addr_thumb2 (pic_reg, pic_rtx));
- emit_insn (gen_pic_load_dot_plus_four (pic_tmp, labelno));
- emit_insn (gen_addsi3 (pic_reg, pic_reg, pic_tmp));
+ emit_insn (gen_pic_add_dot_plus_four (pic_reg, pic_reg, labelno));
}
else /* TARGET_THUMB1 */
{
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index cbb0a1b..ae1aad2 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -1,6 +1,6 @@
;;- Machine description for ARM for GNU compiler
;; Copyright 1991, 1993, 1994, 1995, 1996, 1996, 1997, 1998, 1999, 2000,
-;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
;; Free Software Foundation, Inc.
;; Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl)
;; and Martin Simmons (@harleqn.co.uk).
@@ -5267,7 +5267,7 @@
(const_int 4)
(match_operand 2 "" "")]
UNSPEC_PIC_BASE))]
- "TARGET_THUMB1"
+ "TARGET_THUMB"
"*
(*targetm.asm_out.internal_label) (asm_out_file, \"LPIC\",
INTVAL (operands[2]));