graphite-sese-to-poly.c (pdr_add_data_dimensions): Do not infer loop upper bounds for 1-element arrays at end of structures.

2009-10-20  Sebastian Pop  <sebastian.pop@amd.com>

	* graphite-sese-to-poly.c (pdr_add_data_dimensions): Do not infer
	loop upper bounds for 1-element arrays at end of structures.
	* tree-flow.h (array_at_struct_end_p): Declared.
	* tree-ssa-loop-niter.c (array_at_struct_end_p): Not static anymore.

From-SVN: r154612
This commit is contained in:
Sebastian Pop 2009-11-25 05:18:35 +00:00 committed by Sebastian Pop
parent e34e583538
commit 3899a0b221
4 changed files with 15 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2009-10-20 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (pdr_add_data_dimensions): Do not infer
loop upper bounds for 1-element arrays at end of structures.
* tree-flow.h (array_at_struct_end_p): Declared.
* tree-ssa-loop-niter.c (array_at_struct_end_p): Not static anymore.
2009-10-20 Sebastian Pop <sebastian.pop@amd.com>
* g++.dg/graphite/pr41305.C: New.

View File

@ -1728,10 +1728,12 @@ pdr_add_data_dimensions (ppl_Polyhedron_t accesses, data_reference_p dr,
high = array_ref_up_bound (ref);
/* high - subscript >= 0
XXX: 1-element arrays at end of structures may extend over their
declared size. */
if (high && host_integerp (high, 0))
/* high - subscript >= 0 */
if (high && host_integerp (high, 0)
/* 1-element arrays at end of structures may extend over
their declared size. */
&& !(array_at_struct_end_p (ref)
&& operand_equal_p (low, high, 0)))
{
ppl_new_Linear_Expression_with_dimension (&expr, accessp_nb_dims);
ppl_set_coef (expr, subscript, -1);

View File

@ -728,6 +728,7 @@ tree find_loop_niter (struct loop *, edge *);
tree loop_niter_by_eval (struct loop *, edge);
tree find_loop_niter_by_eval (struct loop *, edge *);
void estimate_numbers_of_iterations (void);
bool array_at_struct_end_p (tree);
bool scev_probably_wraps_p (tree, tree, gimple, struct loop *, bool);
bool convert_affine_scev (struct loop *, tree, tree *, tree *, gimple, bool);

View File

@ -2612,7 +2612,7 @@ record_nonwrapping_iv (struct loop *loop, tree base, tree step, gimple stmt,
allocated structure. If this is the case, the array may be allocated larger
than its upper bound implies. */
static bool
bool
array_at_struct_end_p (tree ref)
{
tree base = get_base_address (ref);