+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>
PR middle-end/33880
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. */
+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>
PR tree-optimization/34966
--- /dev/null
+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;
+}