From: Richard Kenner Date: Fri, 8 Jul 1994 22:22:46 +0000 (-0400) Subject: (expand_expr, case CONVERT_EXPR): If changing signedness and we have a X-Git-Tag: misc/cutover-egcs-0~6257 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5069803972;p=thirdparty%2Fgcc.git (expand_expr, case CONVERT_EXPR): If changing signedness and we have a promoted SUBREG, clear the promotion flag. From-SVN: r7686 --- diff --git a/gcc/expr.c b/gcc/expr.c index d9fe56030c73..5dfc87913390 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -4699,7 +4699,19 @@ expand_expr (exp, target, tmode, modifier) case CONVERT_EXPR: case REFERENCE_EXPR: if (mode == TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)))) - return expand_expr (TREE_OPERAND (exp, 0), target, VOIDmode, modifier); + { + op0 = expand_expr (TREE_OPERAND (exp, 0), target, VOIDmode, + modifier); + + /* If the signedness of the conversion differs and OP0 is + a promoted SUBREG, clear that indication since we now + have to do the proper extension. */ + if (TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0))) != unsignedp + && GET_CODE (op0) == SUBREG) + SUBREG_PROMOTED_VAR_P (op0) = 0; + + return op0; + } if (TREE_CODE (type) == UNION_TYPE) {