diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 78ca0480a21a4c02a65174960f333a5ad2adefc7..c99b9314785ef380de665d084a13428959b3e38f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 0ab06ead9f271c84849fd44d569941571176bc65..6cc5d01912fc3ada265127b439f6642b7f94306e 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -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 (); diff --git a/gcc/varasm.c b/gcc/varasm.c index 891d4e06e572738a0006c8f62edd0d1ed2e83274..ed44610ddf18d3c00febefa3d9e0539cc7a2915c 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -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