+2016-02-02 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/69595
+ * match.pd: Add range test simplifications to true/false.
+
2016-02-02 Thomas Schwinge <thomas@codesourcery.com>
* omp-builtins.def (BUILT_IN_GOACC_HOST_DATA): Remove.
(bit_and:c (ordered @0 @0) (ordered:c@2 @0 @1))
@2)
+/* Simple range test simplifications. */
+/* A < B || A >= B -> true. */
+(for test1 (lt le ne)
+ test2 (ge gt eq)
+ (simplify
+ (bit_ior:c (test1 @0 @1) (test2 @0 @1))
+ (if (INTEGRAL_TYPE_P (TREE_TYPE (@0))
+ || VECTOR_INTEGER_TYPE_P (TREE_TYPE (@0)))
+ { constant_boolean_node (true, type); })))
+/* A < B && A >= B -> false. */
+(for test1 (lt lt lt le ne eq)
+ test2 (ge gt eq gt eq gt)
+ (simplify
+ (bit_and:c (test1 @0 @1) (test2 @0 @1))
+ (if (INTEGRAL_TYPE_P (TREE_TYPE (@0))
+ || VECTOR_INTEGER_TYPE_P (TREE_TYPE (@0)))
+ { constant_boolean_node (false, type); })))
+
/* -A CMP -B -> B CMP A. */
(for cmp (tcc_comparison)
scmp (swapped_tcc_comparison)
+2016-02-02 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/69595
+ * gcc.dg/Warray-bounds-17.c: New testcase.
+
2016-02-02 Richard Biener <rguenther@suse.de>
PR tree-optimization/69606
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -Warray-bounds" } */
+
+char *y;
+void foo (int sysnum)
+{
+ static char *x[] = {};
+ int nsyscalls = sizeof x / sizeof x[0];
+ if (sysnum < 0 || sysnum >= nsyscalls)
+ return;
+ else
+ y = x[sysnum]; /* { dg-bogus "above array bounds" } */
+}