[patch] Fix PR43065: Insert bounds on pointer type parameters
Sebastian Pop
sebpop@gmail.com
Sat Mar 6 00:46:00 GMT 2010
On Fri, Mar 5, 2010 at 17:47, Andrew Pinski <pinskia@gmail.com> wrote:
> On Fri, Mar 5, 2010 at 3:45 PM, Sebastian Pop <sebpop@gmail.com> wrote:
>> Hi,
>>
>> to solve http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43065 we
>> have to insert in the context of the scop the minimal value of a
>> pointer type parameter. I used for this the min and max values
>> of the unsigned type, like this:
>>
>> + else if (POINTER_TYPE_P (type))
>> + {
>> + lb = TYPE_MIN_VALUE (unsigned_type_node);
>> + ub = TYPE_MAX_VALUE (unsigned_type_node);
>> + }
>>
>> Richi, does this look good to you?
>
> unsigned_type_node is most likely incorrect. You most likely want
> sizetype instead.
Ok, then what about like this?
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 8933072..99d83d6 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -1509,8 +1509,8 @@ add_param_constraints (scop_p scop,
ppl_Polyhedron_t context, graphite_dim_t p)
}
else if (POINTER_TYPE_P (type))
{
- lb = TYPE_MIN_VALUE (unsigned_type_node);
- ub = TYPE_MAX_VALUE (unsigned_type_node);
+ lb = TYPE_MIN_VALUE (sizetype);
+ ub = TYPE_MAX_VALUE (sizetype);
}
if (lb)
More information about the Gcc-patches
mailing list