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
This commit is contained in:
Sebastian Pop 2010-06-15 19:11:59 +00:00
parent 94bff63216
commit 6ab4e30772
4 changed files with 26 additions and 15 deletions

View File

@ -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.

View File

@ -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))

View File

@ -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>

View File

@ -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;
}