Diego Novillo <dnovillo@google.com>
PR 31521
* tree-vrp.c (simplify_div_or_mod_using_ranges): Also simplify
if the range includes 0.
2007-08-03 Diego Novillo <dnovillo@google.com>
PR 31521
* gcc.dg/tree-ssa/pr31521.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127180
138bc75d-0d04-0410-961f-
82ee72b054a4
+2007-08-03 Andrew Pinski <andrew_pinski@playstation.sony.com>
+ Diego Novillo <dnovillo@google.com>
+
+ PR 31521
+ * tree-vrp.c (simplify_div_or_mod_using_ranges): Also simplify
+ if the range includes 0.
+
2007-08-03 Ben Elliston <bje@au.ibm.com>
* config/spu/spu.md (dftsv, dftsv_celledp): Attach the appropriate
+2007-08-03 Diego Novillo <dnovillo@google.com>
+
+ PR 31521
+ * gcc.dg/tree-ssa/pr31521.c: New test.
+
2007-08-03 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/32770
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+void fail(void) __attribute__((noreturn));
+int bar(int);
+
+int foo(int x) {
+ int i;
+ int s = 0;
+
+ if (x <= 0) fail();
+ for (i = 0; i < x; ++i) {
+ /* This division by 4 should be replaced with >> 2. */
+ s += bar(i/4);
+ }
+ return s;
+}
+
+/* { dg-final { scan-tree-dump-times " = i_.* >> 2" 1 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
{
bool sop = false;
- val = compare_range_with_value (GT_EXPR, vr, integer_zero_node, &sop);
+ val = compare_range_with_value (GE_EXPR, vr, integer_zero_node, &sop);
if (val
&& sop