+2017-04-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR sanitizer/80349
+ * fold-const.c (fold_binary_loc) <case BIT_IOR_EXPR>: Convert arg0's
+ first argument to type.
+
2017-04-11 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR target/80376
}
if (c3 != c1)
- return fold_build2_loc (loc, BIT_IOR_EXPR, type,
- fold_build2_loc (loc, BIT_AND_EXPR, type,
- TREE_OPERAND (arg0, 0),
- wide_int_to_tree (type,
- c3)),
- arg1);
+ {
+ tem = fold_convert_loc (loc, type, TREE_OPERAND (arg0, 0));
+ tem = fold_build2_loc (loc, BIT_AND_EXPR, type, tem,
+ wide_int_to_tree (type, c3));
+ return fold_build2_loc (loc, BIT_IOR_EXPR, type, tem, arg1);
+ }
}
/* See if this can be simplified into a rotate first. If that
--- /dev/null
+// PR sanitizer/80349
+// { dg-do compile }
+// { dg-options "-fsanitize=undefined" }
+
+extern const long long int v;
+
+void
+foo ()
+{
+ (int)((v & 50 | 051UL) << 0) << 0;
+}