2009-03-17 Jing Yu <jingyu@google.com>
PR middle-end/39378
- * function.h: Move is_thunk from rtl_data structure to function
- structure.
+ * function.h (struct rtl_data): Move is_thunk from here...
+ (struct function): ...to here.
+ * cp/method.c (use_thunk): Change is_thunk from crtl to cfun.
* varasm.c (assemble_start_function): Change is_thunk from crtl to
cfun.
- * config/alpha/alpha.c: Change is_thunk from crtl to cfun.
- * config/rs6000/rs6000.c: Change is_thunk from crtl to cfun.
- * config/arm/arm.h: Change is_thunk from crtl to cfun.
+ * config/alpha/alpha.c (alpha_sa_mask): Change is_thunk from crtl to
+ cfun.
+ (alpha_does_function_need_gp, alpha_start_function): Likewise.
+ (alpha_output_function_end_prologue): Likewise.
+ (alpha_end_function, alpha_output_mi_thunk_osf): Likewise.
+ * config/rs6000/rs6000.c (rs6000_ra_ever_killed): Likewise.
+ (rs6000_output_function_epilogue): Likewise.
+ * config/arm/arm.h (ARM_DECLARE_FUNCTION_NAME): Likewise.
2009-03-17 Uros Bizjak <ubizjak@gmail.com>
--- /dev/null
+/* { dg-options "-mthumb" { target arm*-*-* } } */
+/* { dg-do run } */
+/* { dg-timeout 100 } */
+
+/* PR middle-end/39378 */
+/* Check if the thunk target function is emitted correctly. */
+class B1
+{
+public:
+ virtual int foo1(void);
+ int b1;
+};
+
+class B2
+{
+public:
+ virtual int foo2 (void);
+ int b2;
+};
+
+class D : public B1, public B2
+{
+ int foo1(void);
+ int foo2(void);
+ int d;
+};
+
+int B1::foo1(void)
+{
+ return 3;
+}
+
+int B2::foo2(void)
+{
+ return 4;
+}
+
+int D::foo1(void)
+{
+ return 1;
+}
+
+int D::foo2(void)
+{
+ return 2;
+}
+
+__attribute__((noinline)) int test(B2* bp)
+{
+ return bp->foo2();
+}
+
+int main()
+{
+ B2 *bp = new D();
+ if (test(bp) == 2)
+ return 0;
+ else
+ return 1;
+}