diff options
author | Sebastian Pop <spop@gcc.gnu.org> | 2010-06-15 19:11:59 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2010-06-15 19:11:59 +0000 |
commit | 6ab4e30772ed8513b2ae951524a554d2f05fcc15 (patch) | |
tree | 1c826e17388a4fe39e11ce72d6aa5f01156f43f2 /gcc | |
parent | 94bff63216c58605147ef22357d3bb48eee999ae (diff) | |
download | gcc-6ab4e30772ed8513b2ae951524a554d2f05fcc15.zip gcc-6ab4e30772ed8513b2ae951524a554d2f05fcc15.tar.gz gcc-6ab4e30772ed8513b2ae951524a554d2f05fcc15.tar.bz2 |
Fix PR44391: use size_one_node for pointer types.
2010-06-15 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/44391
* graphite-clast-to-gimple.c (graphite_create_new_loop_guard): Use
size_one_node for pointer types. Do not call gmp_cst_to_tree.
* gcc.dg/graphite/pr44391.c: New.
From-SVN: r160803
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/graphite-clast-to-gimple.c | 17 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/graphite/pr44391.c | 7 |
4 files changed, 26 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 960f2fa..440d145 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,9 +1,15 @@ +2010-06-15 Sebastian Pop <sebastian.pop@amd.com> + + PR middle-end/44391 + * graphite-clast-to-gimple.c (graphite_create_new_loop_guard): Use + size_one_node for pointer types. Do not call gmp_cst_to_tree. + 2010-06-15 Richard Guenther <rguenther@suse.de> * tree-ssa-pre.c (eliminate): Handle PHI elimination to constants. 2010-06-15 Paul Brook <paul@codesourcery.com> - + * config/arm/arm.c (use_vfp_abi): Add sorry() for Thumb-1 hard-float ABI. @@ -196,7 +202,7 @@ 2010-06-14 Ira Rosen <irar@il.ibm.com> - PR tree-optimization/44507 + PR tree-optimization/44507 * tree-vect-loop.c (get_initial_def_for_reduction): Use -1 to build initial vector for BIT_AND_EXPR. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c index 8116afe..b6b8d31 100644 --- a/gcc/graphite-clast-to-gimple.c +++ b/gcc/graphite-clast-to-gimple.c @@ -991,6 +991,7 @@ translate_clast_user (sese region, struct clast_user_stmt *stmt, edge next_e, /* Creates a new if region protecting the loop to be executed, if the execution count is zero (lb > ub). */ + static edge graphite_create_new_loop_guard (sese region, edge entry_edge, struct clast_for *stmt, @@ -1008,22 +1009,14 @@ graphite_create_new_loop_guard (sese region, edge entry_edge, newivs_index, params_index); tree ub = clast_to_gcc_expression (type, stmt->UB, region, newivs, newivs_index, params_index); - tree ub_one; - + tree one = POINTER_TYPE_P (type) ? size_one_node + : fold_convert (type, integer_one_node); /* Adding +1 and using LT_EXPR helps with loop latches that have a loop iteration count of "PARAMETER - 1". For PARAMETER == 0 this becomes 2^{32|64}, and the condition lb <= ub is true, even if we do not want this. However lb < ub + 1 is false, as expected. */ - tree one; - mpz_t gmp_one; - - mpz_init (gmp_one); - mpz_set_si (gmp_one, 1); - one = gmp_cst_to_tree (type, gmp_one); - mpz_clear (gmp_one); - - ub_one = fold_build2 (POINTER_TYPE_P (type) ? POINTER_PLUS_EXPR : PLUS_EXPR, - type, ub, one); + tree ub_one = fold_build2 (POINTER_TYPE_P (type) ? POINTER_PLUS_EXPR + : PLUS_EXPR, type, ub, one); /* When ub + 1 wraps around, use lb <= ub. */ if (integer_zerop (ub_one)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 69dd222..60d29a1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-06-15 Sebastian Pop <sebastian.pop@amd.com> + + PR middle-end/44391 + * gcc.dg/graphite/pr44391.c: New. + 2010-06-15 Janus Weil <janus@gcc.gnu.org> PR fortran/43388 @@ -49,7 +54,7 @@ 2010-06-14 Ira Rosen <irar@il.ibm.com> - PR tree-optimization/44507 + PR tree-optimization/44507 * gcc.dg/vect/pr44507.c: New test. 2010-06-13 H.J. Lu <hongjiu.lu@intel.com> diff --git a/gcc/testsuite/gcc.dg/graphite/pr44391.c b/gcc/testsuite/gcc.dg/graphite/pr44391.c new file mode 100644 index 0000000..91b3afa --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/pr44391.c @@ -0,0 +1,7 @@ +/* { dg-options "-Os -m32 -fgraphite-identity -ffast-math" } */ + +void byte_insert_op1 (unsigned char *loc, unsigned char *end, unsigned *pto) +{ + while (end != loc) + *pto = *--end; +} |