On 06/27/2012 10:45 AM, Richard Guenther wrote: > On Wed, Jun 27, 2012 at 5:02 AM, Richard Henderson <r...@redhat.com> wrote: >> sometimes not (increased code size): >> >> -: 41 bd 01 00 00 00 mov $0x1,%r13d >> -: 4d 89 ec mov %r13,%r12 >> +: 41 bc 01 00 00 00 mov $0x1,%r12d >> +: 41 bd 01 00 00 00 mov $0x1,%r13d > > I suppose that might be fixed if instead of > > + /* Only use the constant when it's just as cheap as a reg move. */ > + if (set_src_cost (c, optimize_function_for_speed_p (cfun)) == 0) > + return c; > > you'd unconditionall use size costs?
I've added some code last year or so in rtl.h to operate on full_rtx_costs, taking both into account (use the primary cost comparison, and if that's equal, use the secondary). Would that work here? Bernd