mirror of git://gcc.gnu.org/git/gcc.git
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
This commit is contained in:
parent
c256730cef
commit
dd3b33d773
|
|
@ -1,3 +1,9 @@
|
||||||
|
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.
|
||||||
|
|
||||||
2008-01-25 Jakub Jelinek <jakub@redhat.com>
|
2008-01-25 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
PR middle-end/33880
|
PR middle-end/33880
|
||||||
|
|
|
||||||
|
|
@ -8920,8 +8920,11 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
|
||||||
target = 0;
|
target = 0;
|
||||||
op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget,
|
op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget,
|
||||||
VOIDmode, EXPAND_NORMAL);
|
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);
|
unsignedp);
|
||||||
|
if (code == LSHIFT_EXPR)
|
||||||
|
temp = REDUCE_BIT_FIELD (temp);
|
||||||
|
return temp;
|
||||||
|
|
||||||
/* Could determine the answer when only additive constants differ. Also,
|
/* Could determine the answer when only additive constants differ. Also,
|
||||||
the addition of one can be handled by changing the condition. */
|
the addition of one can be handled by changing the condition. */
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
2008-01-25 Richard Guenther <rguenther@suse.de>
|
||||||
|
|
||||||
|
PR middle-end/32244
|
||||||
|
* gcc.c-torture/execute/pr32244-1.c: New testcase.
|
||||||
|
|
||||||
2008-01-25 Richard Guenther <rguenther@suse.de>
|
2008-01-25 Richard Guenther <rguenther@suse.de>
|
||||||
|
|
||||||
PR tree-optimization/34966
|
PR tree-optimization/34966
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
struct foo
|
||||||
|
{
|
||||||
|
unsigned long long b:40;
|
||||||
|
} x;
|
||||||
|
|
||||||
|
extern void abort (void);
|
||||||
|
|
||||||
|
void test1(unsigned long long res)
|
||||||
|
{
|
||||||
|
/* The shift is carried out in 40 bit precision. */
|
||||||
|
if (x.b<<32 != res)
|
||||||
|
abort ();
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
x.b = 0x0100;
|
||||||
|
test1(0);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue