aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog.graphite7
-rw-r--r--gcc/graphite-sese-to-poly.c10
-rw-r--r--gcc/tree-flow.h1
-rw-r--r--gcc/tree-ssa-loop-niter.c2
4 files changed, 15 insertions, 5 deletions
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index c2a2f96..05bd2f1 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,12 @@
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.
2009-10-20 Alexander Monakov <amonakov@ispras.ru>
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 214dc8b..b2931d1 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -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);
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h
index bec184d..96e4aa9 100644
--- a/gcc/tree-flow.h
+++ b/gcc/tree-flow.h
@@ -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);
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index 14b44aa..d722210 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -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);