[qfcc] Ensure one is the correct type for incop expressions

This makes for nicer generated code when the incop (especially post) is
used in a condition.
This commit is contained in:
Bill Currie 2023-12-20 22:51:58 +09:00
parent dd183d3ba6
commit 18c0ea3657

View file

@ -2524,6 +2524,9 @@ incop_expr (int op, const expr_t *e, int postop)
return e;
auto one = new_int_expr (1); // int constants get auto-cast to float
if (is_scalar (get_type (e))) {
one = cast_expr (get_type (e), one);
}
if (postop) {
expr_t *t1, *t2;
type_t *type = get_type (e);