* config/arm/arm.c (arm_reorg): Skip Thumb reorg pass for thunks.
(arm32_output_mi_thunk): Deal with long calls.
From-SVN: r264595
+2018-09-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ * config/arm/arm.c (arm_reorg): Skip Thumb reorg pass for thunks.
+ (arm32_output_mi_thunk): Deal with long calls.
+
2018-09-26 Richard Biener <rguenther@suse.de>
PR debug/87428
if (use_cmse)
cmse_nonsecure_call_clear_caller_saved ();
- if (TARGET_THUMB1)
+
+ /* We cannot run the Thumb passes for thunks because there is no CFG. */
+ if (cfun->is_thunk)
+ ;
+ else if (TARGET_THUMB1)
thumb1_reorg ();
else if (TARGET_THUMB2)
thumb2_reorg ();
arm32_output_mi_thunk (FILE *file, tree, HOST_WIDE_INT delta,
HOST_WIDE_INT vcall_offset, tree function)
{
+ const bool long_call_p = arm_is_long_call_p (function);
+
/* On ARM, this_regno is R0 or R1 depending on
whether the function returns an aggregate or not.
*/
TREE_USED (function) = 1;
}
rtx funexp = XEXP (DECL_RTL (function), 0);
+ if (long_call_p)
+ {
+ emit_move_insn (temp, funexp);
+ funexp = temp;
+ }
funexp = gen_rtx_MEM (FUNCTION_MODE, funexp);
- rtx_insn * insn = emit_call_insn (gen_sibcall (funexp, const0_rtx, NULL_RTX));
+ rtx_insn *insn = emit_call_insn (gen_sibcall (funexp, const0_rtx, NULL_RTX));
SIBLING_CALL_P (insn) = 1;
+ emit_barrier ();
+
+ /* Indirect calls require a bit of fixup in PIC mode. */
+ if (long_call_p)
+ {
+ split_all_insns_noflow ();
+ arm_reorg ();
+ }
insn = get_insns ();
shorten_branches (insn);
+2018-09-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ * g++.dg/other/vthunk1.C: Rename to...
+ * g++.dg/other/thunk1.C: ...this.
+ * g++.dg/other/thunk2a.C: New test.
+ * g++.dg/other/thunk2b.C: Likewise.
+
2018-09-25 Jim Wilson <jimw@sifive.com>
* gcc.target/riscv/weak-1.c: New.
--- /dev/null
+// PR c++/12007 Multiple inheritance float pass by value fails
+// { dg-do run }
+
+extern "C" void abort (void);
+
+class gvImpl
+{
+public:
+ virtual void PutVal(float value){}
+};
+
+class foo { public: virtual void Bar(){} };
+
+class myGv: public foo, public gvImpl
+{
+ void PutVal(float value){ if (value != 3.14159f) abort (); }
+};
+
+myGv x;
+gvImpl* object = &x;
+
+int main()
+{
+ object->PutVal(3.14159f);
+ return 0;
+}
--- /dev/null
+// { dg-do compile { target arm*-*-* } }
+// { dg-options "-mlong-calls -ffunction-sections" }
+
+class a {
+public:
+ virtual ~a();
+};
+
+class b : virtual a {};
+
+class c : b {
+ ~c();
+};
+
+c::~c() {}
--- /dev/null
+// { dg-do compile { target arm*-*-* } }
+// { dg-options "-mlong-calls -ffunction-sections" }
+// { dg-additional-options "-fPIC" { target fpic } }
+
+class a {
+public:
+ virtual ~a();
+};
+
+class b : virtual a {};
+
+class c : b {
+ ~c();
+};
+
+c::~c() {}
+++ /dev/null
-// PR c++/12007 Multiple inheritance float pass by value fails
-// { dg-do run }
-
-extern "C" void abort (void);
-
-class gvImpl
-{
-public:
- virtual void PutVal(float value){}
-};
-
-class foo { public: virtual void Bar(){} };
-
-class myGv: public foo, public gvImpl
-{
- void PutVal(float value){ if (value != 3.14159f) abort (); }
-};
-
-myGv x;
-gvImpl* object = &x;
-
-int main()
-{
- object->PutVal(3.14159f);
- return 0;
-}