• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GCC with patches for Dreamcast


Commit MetaInfo

修订版5fb76d406e75acc7223df06b66b95e70705e1185 (tree)
时间2021-03-17 20:17:51
作者Richard Biener <rguenther@suse...>
CommiterRichard Biener

Log Message

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 <rguenther@suse.de>

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.

(cherry picked from commit bb0ec9cffb1d0a3326d8c4ed197717fc08eeec37)

更改概述

差异

--- a/gcc/graphite-isl-ast-to-gimple.c
+++ b/gcc/graphite-isl-ast-to-gimple.c
@@ -266,6 +266,9 @@ gcc_expression_from_isl_ast_expr_id (tree type,
266266 tree t = res->second;
267267 if (useless_type_conversion_p (type, TREE_TYPE (t)))
268268 return t;
269+ if (POINTER_TYPE_P (TREE_TYPE (t))
270+ && !POINTER_TYPE_P (type) && !ptrofftype_p (type))
271+ t = fold_convert (sizetype, t);
269272 return fold_convert (type, t);
270273 }
271274
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -1100,7 +1100,6 @@ static void
11001100 assign_parameter_index_in_region (tree name, sese_info_p region)
11011101 {
11021102 gcc_assert (TREE_CODE (name) == SSA_NAME
1103- && INTEGRAL_TYPE_P (TREE_TYPE (name))
11041103 && ! defined_in_sese_p (name, region->region));
11051104
11061105 int i;
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr93964.c
@@ -0,0 +1,19 @@
1+/* { dg-do compile } */
2+/* { dg-options "-O -floop-nest-optimize" } */
3+
4+int *
5+eo (void);
6+
7+void
8+g4 (int *nt)
9+{
10+ int dh, t2 = (__INTPTR_TYPE__)eo ();
11+
12+ for (dh = 0; dh < 2; ++dh)
13+ {
14+ int m7;
15+
16+ for (m7 = 0; m7 < t2; ++m7)
17+ nt[m7] = 0;
18+ }
19+}