From: Richard Biener Date: Wed, 4 Mar 2020 09:40:32 +0000 (+0100) Subject: tree-optimization/93964 - adjust ISL code generation for pointer params X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dca54007ebb5d49c3d6cea63ee87fd8f3ccb9ca5;p=gcc.git tree-optimization/93964 - adjust ISL code generation for pointer params Pointers eventually need intermediate conversions in code generation. Allowing them is much easier than fending them off since niter and scev expansion easily drag those in. 2020-02-04 Richard Biener PR tree-optimization/93964 * graphite-isl-ast-to-gimple.c (gcc_expression_from_isl_ast_expr_id): Add intermediate conversion for pointer to integer converts. * graphite-scop-detection.c (assign_parameter_index_in_region): Relax assert. * gcc.dg/graphite/pr93964.c: New testcase. --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a08bdaf8ecd..82b66089c8a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2020-02-04 Richard Biener + + PR tree-optimization/93964 + * graphite-isl-ast-to-gimple.c + (gcc_expression_from_isl_ast_expr_id): Add intermediate + conversion for pointer to integer converts. + * graphite-scop-detection.c (assign_parameter_index_in_region): + Relax assert. + 2020-03-04 Martin Liska PR c/93886 diff --git a/gcc/graphite-isl-ast-to-gimple.c b/gcc/graphite-isl-ast-to-gimple.c index c08a259a80e..ef93fda2233 100644 --- a/gcc/graphite-isl-ast-to-gimple.c +++ b/gcc/graphite-isl-ast-to-gimple.c @@ -265,6 +265,9 @@ gcc_expression_from_isl_ast_expr_id (tree type, tree t = res->second; if (useless_type_conversion_p (type, TREE_TYPE (t))) return t; + if (POINTER_TYPE_P (TREE_TYPE (t)) + && !POINTER_TYPE_P (type) && !ptrofftype_p (type)) + t = fold_convert (sizetype, t); return fold_convert (type, t); } diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c index ed12fea801b..75f81227f8a 100644 --- a/gcc/graphite-scop-detection.c +++ b/gcc/graphite-scop-detection.c @@ -1102,7 +1102,6 @@ static void assign_parameter_index_in_region (tree name, sese_info_p region) { gcc_assert (TREE_CODE (name) == SSA_NAME - && INTEGRAL_TYPE_P (TREE_TYPE (name)) && ! defined_in_sese_p (name, region->region)); int i; tree p; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a13a0a4ba59..cbf17163195 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2020-02-04 Richard Biener + + PR tree-optimization/93964 + * gcc.dg/graphite/pr93964.c: New testcase. + 2020-03-04 Jakub Jelinek PR tree-optimization/94001 diff --git a/gcc/testsuite/gcc.dg/graphite/pr93964.c b/gcc/testsuite/gcc.dg/graphite/pr93964.c new file mode 100644 index 00000000000..80fc523b855 --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/pr93964.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O -floop-nest-optimize" } */ + +int * +eo (void); + +void +g4 (int *nt) +{ + int dh, t2 = (__INTPTR_TYPE__)eo (); + + for (dh = 0; dh < 2; ++dh) + { + int m7; + + for (m7 = 0; m7 < t2; ++m7) + nt[m7] = 0; + } +}