Commit 3640d64c by Sebastian Pop Committed by Sebastian Pop

Fix PR43065: Insert bounds on pointer type parameters.

2010-03-05  Sebastian Pop  <sebastian.pop@amd.com>
	    Reza Yazdani  <reza.yazdani@amd.com>

	PR middle-end/43065
	* graphite-sese-to-poly.c (add_param_constraints): Insert bounds
	on pointer type parameters.

	* gcc.dg/graphite/run-id-4.c: New.

Co-Authored-By: Reza Yazdani <reza.yazdani@amd.com>

From-SVN: r157289
parent b75d95c9
2010-03-04 Sebastian Pop <sebastian.pop@amd.com>
2010-03-05 Sebastian Pop <sebastian.pop@amd.com>
Reza Yazdani <reza.yazdani@amd.com>
PR middle-end/43065
* graphite-sese-to-poly.c (add_param_constraints): Insert bounds
on pointer type parameters.
* gcc.dg/graphite/run-id-4.c: New.
2010-03-05 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/43065
* gcc.dg/graphite/run-id-3.c: New.
......
......@@ -1499,13 +1499,19 @@ add_param_constraints (scop_p scop, ppl_Polyhedron_t context, graphite_dim_t p)
ppl_Linear_Expression_t le;
tree parameter = VEC_index (tree, SESE_PARAMS (SCOP_REGION (scop)), p);
tree type = TREE_TYPE (parameter);
tree lb, ub;
tree lb = NULL_TREE;
tree ub = NULL_TREE;
if (!INTEGRAL_TYPE_P (type))
return;
lb = TYPE_MIN_VALUE (type);
ub = TYPE_MAX_VALUE (type);
if (INTEGRAL_TYPE_P (type))
{
lb = TYPE_MIN_VALUE (type);
ub = TYPE_MAX_VALUE (type);
}
else if (POINTER_TYPE_P (type))
{
lb = TYPE_MIN_VALUE (unsigned_type_node);
ub = TYPE_MAX_VALUE (unsigned_type_node);
}
if (lb)
{
......
/* PR rtl-optimization/24899 */
extern void abort (void);
__attribute__ ((noinline)) int
foo (int x, int y, int *z)
{
int a, b, c, d;
a = b = 0;
for (d = 0; d < y; d++)
{
if (z)
b = d * *z;
for (c = 0; c < x; c++)
a += b;
}
return a;
}
int
main (void)
{
if (foo (3, 2, 0) != 0)
abort ();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment