2017-04-11 Jakub Jelinek <jakub@redhat.com>
+ PR middle-end/80100
+ * simplify-rtx.c (simplify_binary_operation_1) <case IOR>: Perform
+ left shift in unsigned HOST_WIDE_INT type.
+
PR rtl-optimization/80385
* simplify-rtx.c (simplify_unary_operation_1): Don't transform
(not (neg X)) into (plus X -1) for complex or non-integral modes.
&& CONST_INT_P (XEXP (op0, 1))
&& INTVAL (XEXP (op0, 1)) < HOST_BITS_PER_WIDE_INT)
{
- int count = INTVAL (XEXP (op0, 1));
- HOST_WIDE_INT mask = INTVAL (trueop1) << count;
+ int count = INTVAL (XEXP (op0, 1));
+ HOST_WIDE_INT mask = UINTVAL (trueop1) << count;
if (mask >> count == INTVAL (trueop1)
&& trunc_int_for_mode (mask, mode) == mask
2017-04-11 Jakub Jelinek <jakub@redhat.com>
+ PR middle-end/80100
+ * gcc.dg/pr80100.c: New test.
+
PR rtl-optimization/80385
* g++.dg/opt/pr80385.C: New test.
--- /dev/null
+/* PR middle-end/80100 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+long int
+foo (long int x)
+{
+ return 2L | ((x - 1L) >> (__SIZEOF_LONG__ * __CHAR_BIT__ - 1));
+}