]> gcc.gnu.org Git - gcc.git/commitdiff
re PR middle-end/39378 (Multiple inheritence thunk not working with -mthumb)
authorJing Yu <jingyu@google.com>
Tue, 17 Mar 2009 20:18:21 +0000 (20:18 +0000)
committerDoug Kwan <dougkwan@gcc.gnu.org>
Tue, 17 Mar 2009 20:18:21 +0000 (20:18 +0000)
2009-03-12  Jing Yu  <jingyu@google.com>

PR middle-end/39378
* function.h: Move is_thunk from rtl_data structure to function
structure.
* 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.
* testsuite/g++.dg/inherit/thunk10.C: New file.

Patch submitted by Doug Kwan <dougkwan@google.com>

From-SVN: r144918

gcc/ChangeLog
gcc/config/alpha/alpha.c
gcc/config/arm/arm.h
gcc/config/rs6000/rs6000.c
gcc/cp/method.c
gcc/function.h
gcc/testsuite/ChangeLog
gcc/varasm.c

index 4af4b4f7d456e332f7a61a606352d82ddfd41531..7875277f45e434c321b9cce3ac09414fa15ef79e 100644 (file)
@@ -1,3 +1,15 @@
+2009-03-17  Jing Yu  <jingyu@google.com>
+
+       PR middle-end/39378
+       * function.h: Move is_thunk from rtl_data structure to function
+       structure.
+       * 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.
+
 2009-03-17  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/39482
index 0675916a230f4e74f501add86a0ec7a43ac2f068..5ffb8f967ff536a4240c2046117cbcff55699569 100644 (file)
@@ -7135,7 +7135,7 @@ alpha_sa_mask (unsigned long *imaskP, unsigned long *fmaskP)
   /* When outputting a thunk, we don't have valid register life info,
      but assemble_start_function wants to output .frame and .mask
      directives.  */
-  if (crtl->is_thunk)
+  if (cfun->is_thunk)
     {
       *imaskP = 0;
       *fmaskP = 0;
@@ -7365,7 +7365,7 @@ alpha_does_function_need_gp (void)
     return 1;
 
   /* The code emitted by alpha_output_mi_thunk_osf uses the gp.  */
-  if (crtl->is_thunk)
+  if (cfun->is_thunk)
     return 1;
 
   /* The nonlocal receiver pattern assumes that the gp is valid for
@@ -7888,7 +7888,7 @@ alpha_start_function (FILE *file, const char *fnname,
         Otherwise, do it here.  */
       if (TARGET_ABI_OSF
           && ! alpha_function_needs_gp
-         && ! crtl->is_thunk)
+         && ! cfun->is_thunk)
        {
          putc ('$', file);
          assemble_name (file, fnname);
@@ -7999,7 +7999,7 @@ alpha_output_function_end_prologue (FILE *file)
     fputs ("\t.prologue 0\n", file);
   else if (!flag_inhibit_size_directive)
     fprintf (file, "\t.prologue %d\n",
-            alpha_function_needs_gp || crtl->is_thunk);
+            alpha_function_needs_gp || cfun->is_thunk);
 }
 
 /* Write function epilogue.  */
@@ -8283,7 +8283,7 @@ alpha_end_function (FILE *file, const char *fnname, tree decl ATTRIBUTE_UNUSED)
     output_asm_insn (get_insn_template (CODE_FOR_nop, NULL), NULL);
 
 #if TARGET_ABI_OSF
-  if (crtl->is_thunk)
+  if (cfun->is_thunk)
     free_after_compilation (cfun);
 #endif
 
@@ -8326,7 +8326,7 @@ alpha_output_mi_thunk_osf (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
   HOST_WIDE_INT hi, lo;
   rtx this_rtx, insn, funexp;
 
-  gcc_assert (crtl->is_thunk);
+  gcc_assert (cfun->is_thunk);
 
   /* We always require a valid GP.  */
   emit_insn (gen_prologue_ldgp ());
index 7788793b3009b8add1ca5dafaaaa4de2c4ff570b..f5ec9e7166e400f329e782907809009820278b62 100644 (file)
@@ -2448,7 +2448,7 @@ extern int making_const_table;
         {                                              \
           if (is_called_in_ARM_mode (DECL)             \
              || (TARGET_THUMB1 && !TARGET_THUMB1_ONLY  \
-                 && crtl->is_thunk))   \
+                 && cfun->is_thunk))   \
             fprintf (STREAM, "\t.code 32\n") ;         \
           else if (TARGET_THUMB1)                      \
            fprintf (STREAM, "\t.code\t16\n\t.thumb_func\n") ;  \
index 3073561c9f0bc84d092ead5d25897c6166d1a7aa..17622c26f00666b4218cad2fb8e47f75ad852cc9 100644 (file)
@@ -15254,7 +15254,7 @@ rs6000_ra_ever_killed (void)
   rtx reg;
   rtx insn;
 
-  if (crtl->is_thunk)
+  if (cfun->is_thunk)
     return 0;
 
   /* regs_ever_live has LR marked as used if any sibcalls are present,
@@ -17556,7 +17556,7 @@ rs6000_output_function_epilogue (FILE *file,
      System V.4 Powerpc's (and the embedded ABI derived from it) use a
      different traceback table.  */
   if (DEFAULT_ABI == ABI_AIX && ! flag_inhibit_size_directive
-      && rs6000_traceback != traceback_none && !crtl->is_thunk)
+      && rs6000_traceback != traceback_none && !cfun->is_thunk)
     {
       const char *fname = NULL;
       const char *language_string = lang_hooks.name;
index 5b4c273dda98590e9ec1450339983847a0545a2c..e632fe0c9e6b41722f8475064cdff94e871ff55c 100644 (file)
@@ -436,7 +436,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
       BLOCK_VARS (fn_block) = a;
       DECL_INITIAL (thunk_fndecl) = fn_block;
       init_function_start (thunk_fndecl);
-      crtl->is_thunk = 1;
+      cfun->is_thunk = 1;
       assemble_start_function (thunk_fndecl, fnname);
 
       targetm.asm_out.output_mi_thunk (asm_out_file, thunk_fndecl,
index 3f03727dfdcf6eee56d7b546c9212f4ce319a921..f9bdda8594d50c0618ae9452b4150f429f17bd11 100644 (file)
@@ -378,12 +378,6 @@ struct rtl_data GTY(())
   /* Nonzero if function being compiled has an asm statement.  */
   bool has_asm_statement;
 
-  /* Nonzero if the current function is a thunk, i.e., a lightweight
-     function implemented by the output_mi_thunk hook) that just
-     adjusts one of its arguments and forwards to another
-     function.  */
-  bool is_thunk;
-
   /* This bit is used by the exception handling logic.  It is set if all
      calls (if any) are sibling calls.  Such functions do not have to
      have EH tables generated, as they cannot throw.  A call to such a
@@ -600,6 +594,12 @@ struct function GTY(())
   /* Nonzero if this function has local DECL_HARD_REGISTER variables.
      In this case code motion has to be done more carefully.  */
   unsigned int has_local_explicit_reg_vars : 1;
+
+  /* Nonzero if the current function is a thunk, i.e., a lightweight
+     function implemented by the output_mi_thunk hook) that just
+     adjusts one of its arguments and forwards to another
+     function.  */
+  unsigned int is_thunk : 1;
 };
 
 /* If va_list_[gf]pr_size is set to this, it means we don't know how
index 31651843422fd163e0cd06629e27aba8d975e069..51bd91512ab82d26182374872f817b44529c11e4 100644 (file)
@@ -1,3 +1,8 @@
+2009-03-17  Jing Yu  <jingyu@google.com>
+
+       PR middle-end/39378
+       * g++.dg/inherit/thunk10.C: New test.
+
 2009-03-17  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/39482
index c724fcd721ec35edd6b2b01eda4a98ad16366bc9..e5b9f35fee9ae9916c984574e1e6a51b385bcc9d 100644 (file)
@@ -1677,7 +1677,7 @@ assemble_start_function (tree decl, const char *fnname)
       /* When the function starts with a cold section, we need to explicitly
         align the hot section and write out the hot section label.
         But if the current function is a thunk, we do not have a CFG.  */
-      if (!crtl->is_thunk
+      if (!cfun->is_thunk
          && BB_PARTITION (ENTRY_BLOCK_PTR->next_bb) == BB_COLD_PARTITION)
        {
          switch_to_section (text_section);
This page took 0.141464 seconds and 5 git commands to generate.