]> git.ipfire.org Git - thirdparty/gcc.git/commit
graphite: Fix non-INTEGER_TYPE integral comparison handling [PR114041]
authorJakub Jelinek <jakub@redhat.com>
Wed, 28 Feb 2024 08:59:45 +0000 (09:59 +0100)
committerJakub Jelinek <jakub@redhat.com>
Wed, 28 Feb 2024 08:59:45 +0000 (09:59 +0100)
commitd6479050ecef10fd5e67b4da989229e4cfac53ee
treeea1431e480d654a2f52fd5eb7ea35965c2296153
parentcc383e9702897dd783657ea3dce4aecf48318441
graphite: Fix non-INTEGER_TYPE integral comparison handling [PR114041]

The following testcases are miscompiled, because graphite ignores boolean,
enumerated or _BitInt comparisons, rewrites the code as if the comparisons
were always true or always false.

The INTEGER_TYPE checks were initially added in r6-2239 but at that point
it was both in add_conditions_to_domain and in parameter_index_in_region.
Later on the check was also added to stmt_simple_for_scop_p, and finally
r8-3931 changed the stmt_simple_for_scop_p check to INTEGRAL_TYPE_P
and turned the parameter_index_in_region -> assign_parameter_index_in_region
into INTEGRAL_TYPE_P assertion, but the add_conditions_to_domain check
for INTEGER_TYPE remained.

The following patch uses INTEGRAL_TYPE_P to complete the change.

2024-02-28  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/114041
* graphite-sese-to-poly.cc (add_conditions_to_domain): Check for
INTEGRAL_TYPE_P check rather than INTEGER_TYPE.

* gcc.dg/graphite/run-id-pr114041-1.c: New test.
* gcc.dg/graphite/run-id-pr114041-2.c: New test.
gcc/graphite-sese-to-poly.cc
gcc/testsuite/gcc.dg/graphite/run-id-pr114041-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/graphite/run-id-pr114041-2.c [new file with mode: 0644]