mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-24 13:11:44 +08:00
[multiple changes]
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 Diego Novillo <dnovillo@google.com> PR 31521 * gcc.dg/tree-ssa/pr31521.c: New test. From-SVN: r127180
This commit is contained in:
parent
5e56953d9a
commit
737b089116
gcc
@ -1,3 +1,10 @@
|
||||
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
|
||||
|
@ -1,3 +1,8 @@
|
||||
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
|
||||
|
20
gcc/testsuite/gcc.dg/tree-ssa/pr31521.c
Normal file
20
gcc/testsuite/gcc.dg/tree-ssa/pr31521.c
Normal file
@ -0,0 +1,20 @@
|
||||
/* { 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" } } */
|
@ -5541,7 +5541,7 @@ simplify_div_or_mod_using_ranges (tree stmt, tree rhs, enum tree_code rhs_code)
|
||||
{
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user