diff options
author | Richard Guenther <rguenther@suse.de> | 2008-01-25 15:33:09 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2008-01-25 15:33:09 +0000 |
commit | dd3b33d7730a9d11c2cd809df030fc59ac5ca232 (patch) | |
tree | 0c1732108c28dfd96d0a904da58046653148d363 /gcc/expr.c | |
parent | c256730cefa52bbb322ca3759a0411f9e245d366 (diff) | |
download | gcc-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.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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. */ |