From: Julian Brown Date: Fri, 20 Jun 2014 05:38:40 +0000 (+0000) Subject: arm.c (arm_output_mi_thunk): Fix offset for TARGET_THUMB1_ONLY. X-Git-Tag: releases/gcc-5.1.0~6765 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6d45574aa297574840e7b0d4ab3ec13f7d9d5b64;p=thirdparty%2Fgcc.git arm.c (arm_output_mi_thunk): Fix offset for TARGET_THUMB1_ONLY. 2014-06-20 Julian Brown Chung-Lin Tang * config/arm/arm.c (arm_output_mi_thunk): Fix offset for TARGET_THUMB1_ONLY. Add comments. Co-Authored-By: Chung-Lin Tang From-SVN: r211834 --- 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,