PR middle-end/46667
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 14 Dec 2010 13:07:05 +0000 (13:07 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 14 Dec 2010 13:07:05 +0000 (13:07 +0000)
* varasm.c (assemble_start_function): Do not call resolve_unique_section.
* cfgexpand.c (gimple_expand_cfg): Resolve it here.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167795 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cfgexpand.c
gcc/varasm.c

index 78ca048..c99b931 100644 (file)
@@ -1,3 +1,9 @@
+2010-12-14  Jan Hubicka  <jh@suse.cz>
+
+       PR middle-end/46667
+       * varasm.c (assemble_start_function): Do not call resolve_unique_section.
+       * cfgexpand.c (gimple_expand_cfg): Resolve it here.
+
 2010-12-14  Alexander Monakov  <amonakov@ispras.ru>
 
        PR rtl-optimization/46875
index 0ab06ea..6cc5d01 100644 (file)
@@ -3951,6 +3951,10 @@ gimple_expand_cfg (void)
   crtl->preferred_stack_boundary = STACK_BOUNDARY;
   cfun->cfg->max_jumptable_ents = 0;
 
+  /* Resovle the function section.  Some targets, like ARM EABI rely on knowledge
+     of the function section at exapnsion time to predict distance of calls.  */
+  resolve_unique_section (current_function_decl, 0, flag_function_sections);
+
   /* Expand the variables recorded during gimple lowering.  */
   timevar_push (TV_VAR_EXPAND);
   start_sequence ();
index 891d4e0..ed44610 100644 (file)
@@ -1551,8 +1551,6 @@ assemble_start_function (tree decl, const char *fnname)
   if (CONSTANT_POOL_BEFORE_FUNCTION)
     output_constant_pool (fnname, decl);
 
-  resolve_unique_section (decl, 0, flag_function_sections);
-
   /* Make sure the not and cold text (code) sections are properly
      aligned.  This is necessary here in the case where the function
      has both hot and cold sections, because we don't want to re-set