From 327cb88af307c74d004f53ecda93793eb1494ac6 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 29 Aug 2023 08:02:11 +0900 Subject: [PATCH] [qfcc] Demote implicit double vector literals correctly The code for demoting the literals wasn't taking the width into account. --- tools/qfcc/source/expr_binary.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/qfcc/source/expr_binary.c b/tools/qfcc/source/expr_binary.c index 07bc75ebe..efcbc61ff 100644 --- a/tools/qfcc/source/expr_binary.c +++ b/tools/qfcc/source/expr_binary.c @@ -1128,11 +1128,11 @@ binary_expr (int op, expr_t *e1, expr_t *e2) } if (is_constant (e1) && is_double (t1) && e1->implicit && is_float (t2)) { - t1 = &type_float; + t1 = float_type (t2); e1 = cast_expr (t1, e1); } if (is_constant (e2) && is_double (t2) && e2->implicit && is_float (t1)) { - t2 = &type_float; + t2 = float_type (t1); e2 = cast_expr (t2, e2); } if (is_array (t1) && (is_ptr (t2) || is_integral (t2))) {