summaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-01-25 15:33:09 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-01-25 15:33:09 +0000
commit5c9c131f3aed1b7d78fea1a09b9ce9241304320b (patch)
tree0c1732108c28dfd96d0a904da58046653148d363 /gcc/expr.c
parentb43fc0dc6333c862d43f9db0e51334ac53007d81 (diff)
downloadgcc-5c9c131f3aed1b7d78fea1a09b9ce9241304320b.tar.gz
2008-01-25 Richard Guenther <rguenther@suse.de>
PR middle-end/32244 * expr.c (expand_expr_real_1): Reduce result of LSHIFT_EXPR to its bitfield precision if required. * gcc.c-torture/execute/pr32244-1.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131828 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 84dab2f4871..53cb3eb9d2c 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -8920,8 +8920,11 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
target = 0;
op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget,
VOIDmode, EXPAND_NORMAL);
- return expand_shift (code, mode, op0, TREE_OPERAND (exp, 1), target,
+ temp = expand_shift (code, mode, op0, TREE_OPERAND (exp, 1), target,
unsignedp);
+ if (code == LSHIFT_EXPR)
+ temp = REDUCE_BIT_FIELD (temp);
+ return temp;
/* Could determine the answer when only additive constants differ. Also,
the addition of one can be handled by changing the condition. */