From: Robert Pengelly Date: Sun, 15 Nov 2026 22:20:37 +0000 (+0000) Subject: amd64: Preserve cast signedness in arithmetic expressions X-Git-Url: https://git.candlhat.org/?a=commitdiff_plain;h=3125175d97e7c80c77b89c902527ea706bce28b3;p=scc.git amd64: Preserve cast signedness in arithmetic expressions --- diff --git a/amd64.c b/amd64.c index 47b5476..8ed68af 100644 --- a/amd64.c +++ b/amd64.c @@ -28417,8 +28417,14 @@ static int emit_load_assignment_binary_expression_prec_to_reg (const char *reg, int expr_pointed_size; is_unsigned = rhs_current_operand_is_unsigned_now (); + rhs_last_explicit_integer_cast_signedness = -1; + emit_load_assignment_rhs_to_reg (reg); + if (rhs_last_explicit_integer_cast_signedness >= 0) { + is_unsigned = rhs_last_explicit_integer_cast_signedness; + } + /* * Some statement-condition paths can leave a postfix member chain after * the primary operand, e.g. inside parenthesized logical RHS terms such as