+2009-07-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/40692
+ * fold-const.c (fold_cond_expr_with_comparison): Don't replace
+ arg1 with arg01 if arg1 is already INTEGER_CST.
+
2009-07-08 Adam Nemet <anemet@caviumnetworks.com>
* simplify-rtx.c (simplify_binary_operation_1) <AND>: Transform (and
switch (comp_code)
{
case EQ_EXPR:
+ if (TREE_CODE (arg1) == INTEGER_CST)
+ break;
/* We can replace A with C1 in this case. */
arg1 = fold_convert (type, arg01);
return fold_build3 (COND_EXPR, type, arg0, arg1, arg2);
+2009-07-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/40692
+ * gcc.c-torture/compile/pr40692.c: New test.
+
2009-07-09 Tobias Burnus <burnus@net-b.de>
PR fortran/40604
--- /dev/null
+/* PR middle-end/40692 */
+
+#define M1(x) (((x) & 0x00000002) ? 0x2 : ((x) & 0x1))
+#define M2(x) (((x) & 0x0000000c) ? M1 ((x) >> 2) << 2 : M1 (x))
+#define M3(x) (((x) & 0x000000f0) ? M2 ((x) >> 4) << 4 : M2 (x))
+#define M4(x) (((x) & 0x0000ff00) ? M3 ((x) >> 8) << 8 : M3 (x))
+#define M5(x) (((x) & 0xffff0000) ? M4 ((x) >> 16) << 16 : M4 (x))
+
+struct A { char e; char f; };
+
+long
+foo (void)
+{
+ return M5 (4096UL - (long) &((struct A *) 0)->f);
+}