> Can you use the TMR_OFFSET macro rather than TREE_OPERAND (op0, 1)? > > It also seems that you need a stronger check here. > > Essentially you have to verify that > STEP * INDEX + INDEX2 + OFFSET == 0 > > Right?
No, it's MEM_REF, not TARGET_MEM_REF, see build_fold_addr_expr_with_type_loc. -- Eric Botcazou