diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-07-08 18:22:46 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-07-08 18:22:46 -0400 |
commit | 506980397227045212375e2dd2a1ae68a1afd481 (patch) | |
tree | c4ce734dd53f8400c19bbc147910521867875b30 | |
parent | 6be583037c3cc9bd254d252e6b50a7f3dba27879 (diff) | |
download | gcc-506980397227045212375e2dd2a1ae68a1afd481.zip gcc-506980397227045212375e2dd2a1ae68a1afd481.tar.gz gcc-506980397227045212375e2dd2a1ae68a1afd481.tar.bz2 |
(expand_expr, case CONVERT_EXPR): If changing signedness and we have a
promoted SUBREG, clear the promotion flag.
From-SVN: r7686
-rw-r--r-- | gcc/expr.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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) { |