+2016-08-12 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR middle-end/71654
+ * match.pd ((T)A CMP (T)B -> A CMP B): Allow (T)A to be a
+ sign-changing cast from a shorter unsigned type to a wider
+ signed type.
+
2016-08-12 Jakub Jelinek <jakub@redhat.com>
* config/i386/sse.md (avx512dq_vextract<shuffletype>64x2_1_maskm,
(if (TYPE_PRECISION (TREE_TYPE (@0)) > TYPE_PRECISION (TREE_TYPE (@00)))
/* If possible, express the comparison in the shorter mode. */
(if ((cmp == EQ_EXPR || cmp == NE_EXPR
- || TYPE_UNSIGNED (TREE_TYPE (@0)) == TYPE_UNSIGNED (TREE_TYPE (@00)))
+ || TYPE_UNSIGNED (TREE_TYPE (@0)) == TYPE_UNSIGNED (TREE_TYPE (@00))
+ || (!TYPE_UNSIGNED (TREE_TYPE (@0))
+ && TYPE_UNSIGNED (TREE_TYPE (@00))))
&& (types_match (TREE_TYPE (@10), TREE_TYPE (@00))
|| ((TYPE_PRECISION (TREE_TYPE (@00))
>= TYPE_PRECISION (TREE_TYPE (@10)))
+2016-08-12 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR middle-end/71654
+ * gcc.dg/c-c++-common/pr71654.c: New test.
+ * gcc.dg/tree-ssa/vrp23: Add -fno-tree-forwprop to
+ dg-options.
+ * gcc.dg/tree-ssa/vrp24: Likewise.
+
2016-08-12 Jakub Jelinek <jakub@redhat.com>
PR c/67410
--- /dev/null
+/* PR middle-end/71654 */
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+unsigned char i0, i1;
+
+void foo (void);
+
+int
+main (void)
+{
+ int j = i0;
+ if (j < 4)
+ {
+ if (i0 & 4)
+ foo ();
+ }
+
+ unsigned int k = i1;
+ if (k < 8)
+ {
+ if (i1 & 8)
+ foo ();
+ }
+
+ return 0;
+}
+
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-vrp1-details" } */
+/* { dg-options "-O2 -fno-tree-forwprop -fdump-tree-vrp1-details" } */
void aa (void);
void aos (void);
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-vrp1-details" } */
+/* { dg-options "-O2 -fno-tree-forwprop -fdump-tree-vrp1-details" } */
struct rtx_def;