On 07/20/2011 07:16 AM, Georg-Johann Lay wrote: > case CONST_INT: > case CONST_DOUBLE: > + case SYMBOL_REF: > /* Immediate constants are as cheap as registers. */ > *total = 0; > return true; > @@ -5348,7 +5349,6 @@ avr_rtx_costs (rtx x, int codearg, int o > case MEM: > case CONST: > case LABEL_REF: > - case SYMBOL_REF: > *total = COSTS_N_INSNS (GET_MODE_SIZE (mode));
If you're going to change SYMBOL_REF, then you should also change CONST and LABEL_REF. Examine your test case with 'x[2+i]', which ought to be folded to (const (plus (symbol_ref) (const_int 2))) and printed as lo8(-(x+2)) etc. r~