https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62631
--- Comment #9 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> --- > --- Comment #8 from Eric Botcazou <ebotcazou at gcc dot gnu.org> --- >> I think that's easiest for Eric to say. > > Not really, I guess you want to debug the function and replay the computation > since the cost is synthetized and doesn't come directly from the back-end. I've found what's going on: * In expmed.c (init_expmed_one_mode), l.194 set_shiftadd_cost (speed, mode, m, set_src_cost (all->shift_add, speed)); with all->shift_add something like (plus:QI (mult:QI (reg:QI 109 [0]) (const_int 8 [0x8])) (reg:QI 109 [0])) * For the mult part, rtx_code calls sparc_rtx_cost, which has case MULT: if (float_mode_p) *total = sparc_costs->float_mul; else if (! TARGET_HARD_MUL) *total = COSTS_N_INSNS (25); On SPARCv9/-m64, TARGET_HARD_MUL is false, so we get the 25*4 = 100 part, unlike v8, which explains why the test only fails for 64-bit. Rainer