Fix missing file and ChangeLog error in previous check-in
authorJing Yu <jingyu@google.com>
Wed, 18 Mar 2009 21:58:15 +0000 (21:58 +0000)
committerDoug Kwan <dougkwan@gcc.gnu.org>
Wed, 18 Mar 2009 21:58:15 +0000 (21:58 +0000)
From-SVN: r144945

gcc/ChangeLog
gcc/testsuite/g++.dg/inherit/thunk10.C [new file with mode: 0644]

index 19b4a60..adc0ba3 100644 (file)
 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>
 
diff --git a/gcc/testsuite/g++.dg/inherit/thunk10.C b/gcc/testsuite/g++.dg/inherit/thunk10.C
new file mode 100644 (file)
index 0000000..7020677
--- /dev/null
@@ -0,0 +1,60 @@
+/* { 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;
+}