From: cltang Date: Fri, 20 Jun 2014 05:38:40 +0000 (+0000) Subject: 2014-06-20 Julian Brown X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ee204f6665c27c671355ba1bfd56d99dce562cbf;p=thirdparty%2Fgcc.git 2014-06-20 Julian Brown Chung-Lin Tang * config/arm/arm.c (arm_output_mi_thunk): Fix offset for TARGET_THUMB1_ONLY. Add comments. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211834 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3e43695dc88c..03ce0d2b3cc7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-06-20 Julian Brown + Chung-Lin Tang + + * config/arm/arm.c (arm_output_mi_thunk): Fix offset for + TARGET_THUMB1_ONLY. Add comments. + 2014-06-19 Tom de Vries * config/aarch64/aarch64-protos.h (aarch64_emit_call_insn): Change diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index d293b5b24f41..70682f1189e0 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -28455,9 +28455,13 @@ arm_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, fputs (":\n", file); if (flag_pic) { - /* Output ".word .LTHUNKn-7-.LTHUNKPCn". */ + /* Output ".word .LTHUNKn-[3,7]-.LTHUNKPCn". */ rtx tem = XEXP (DECL_RTL (function), 0); - tem = plus_constant (GET_MODE (tem), tem, -7); + /* For TARGET_THUMB1_ONLY the thunk is in Thumb mode, so the PC + pipeline offset is four rather than eight. Adjust the offset + accordingly. */ + tem = plus_constant (GET_MODE (tem), tem, + TARGET_THUMB1_ONLY ? -3 : -7); tem = gen_rtx_MINUS (GET_MODE (tem), tem, gen_rtx_SYMBOL_REF (Pmode,