Sorry for the delay in reviewing but I've been investigating the
asymmetry between trunc and the other integer rounding functions;
round, floor and ceil. The following code from expr.c explains a
lot:
case FIX_ROUND_EXPR:
case FIX_FLOOR_EXPR:
case FIX_CEIL_EXPR:
gcc_unreachable (); /* Not used for C. */
case FIX_TRUNC_EXPR:
op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, VOIDmode, 0);
if (target == 0 || modifier == EXPAND_STACK_PARM)
target = gen_reg_rtx (mode);
expand_fix (target, op0, unsignedp);
return target;
So although tree codes are defined for the other "fix" conversions,
it's clearly unsafe to use them. It's not clear what the best way
to clean this up is (either add to add the missing support or to
remove the partially implemented tree codes). An issue for another
day...