aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-07-08 18:22:46 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1994-07-08 18:22:46 -0400
commit506980397227045212375e2dd2a1ae68a1afd481 (patch)
treec4ce734dd53f8400c19bbc147910521867875b30 /gcc
parent6be583037c3cc9bd254d252e6b50a7f3dba27879 (diff)
downloadgcc-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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/expr.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index d9fe560..5dfc879 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)
{