]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: arm.c (arm_output_mi_thunk): Fix offset for TARGET_THUMB1_ONLY.
authorChung-Lin Tang <cltang@codesourcery.com>
Fri, 20 Jun 2014 06:20:38 +0000 (06:20 +0000)
committerChung-Lin Tang <cltang@gcc.gnu.org>
Fri, 20 Jun 2014 06:20:38 +0000 (06:20 +0000)
2014-06-20  Chung-Lin Tang  <cltang@codesourcery.com>

Backport from mainline

2014-06-20  Julian Brown  <julian@codesourcery.com>
            Chung-Lin Tang  <cltang@codesourcery.com>

* config/arm/arm.c (arm_output_mi_thunk): Fix offset for
TARGET_THUMB1_ONLY. Add comments.

From-SVN: r211835

gcc/ChangeLog
gcc/config/arm/arm.c

index c9bcd2abc4c2152098feafaabc4eee89e13f7127..45da7447803b531ab050a498e7a69a0eaa8bfb11 100644 (file)
@@ -1,3 +1,13 @@
+2014-06-20  Chung-Lin Tang  <cltang@codesourcery.com>
+
+       Backport from mainline
+
+       2014-06-20  Julian Brown  <julian@codesourcery.com>
+                   Chung-Lin Tang  <cltang@codesourcery.com>
+
+       * config/arm/arm.c (arm_output_mi_thunk): Fix offset for
+       TARGET_THUMB1_ONLY. Add comments.
+
 2014-06-18  Uros Bizjak  <ubizjak@gmail.com>
 
        Backport from mainline
index 5bc66034ed931c2cca15c85deb1e1bf204432aa3..e42d0b996ed7d72a9ef85a18e2265d3a3286d3bd 100644 (file)
@@ -24476,9 +24476,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 = gen_rtx_PLUS (GET_MODE (tem), tem, GEN_INT (-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,