It seems wrong to pass &tmp to gimplify_expr: don't you need to actually update the value in TYPE_SIZE_UNIT so that when it's used, what's there is GIMPLE?