Hi, this patch makes branch_cost to be stable over optimize_size and optimize to allow inlining. This is safe because BRANCH_COST macro will use constant of 2 for all branches optimized for size.
Bootstrapped/regtested x86_64-linux, comitted. PR lto/45375 * i386.c (ix86_option_override_internal): Use ix86_tune_cost to set branch cost. Index: config/i386/i386.c =================================================================== --- config/i386/i386.c (revision 219876) +++ config/i386/i386.c (working copy) @@ -3919,7 +3919,7 @@ ix86_option_override_internal (bool main /* Provide default for -mbranch-cost= value. */ if (!opts_set->x_ix86_branch_cost) - opts->x_ix86_branch_cost = ix86_cost->branch_cost; + opts->x_ix86_branch_cost = ix86_tune_cost->branch_cost; if (TARGET_64BIT_P (opts->x_ix86_isa_flags)) {