aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2008-01-25 15:33:09 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2008-01-25 15:33:09 +0000
commitdd3b33d7730a9d11c2cd809df030fc59ac5ca232 (patch)
tree0c1732108c28dfd96d0a904da58046653148d363 /gcc/expr.c
parentc256730cefa52bbb322ca3759a0411f9e245d366 (diff)
downloadgcc-dd3b33d7730a9d11c2cd809df030fc59ac5ca232.zip
gcc-dd3b33d7730a9d11c2cd809df030fc59ac5ca232.tar.gz
gcc-dd3b33d7730a9d11c2cd809df030fc59ac5ca232.tar.bz2
re PR middle-end/32244 (bit-field: optimization BUG)
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. From-SVN: r131828
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 84dab2f..53cb3eb 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. */