]> git.ipfire.org Git - thirdparty/gcc.git/commit
openmp: Fix ICE on non-rectangular loop with known 0 iterations
authorJakub Jelinek <jakub@redhat.com>
Wed, 18 Nov 2020 08:40:45 +0000 (09:40 +0100)
committerKwok Cheung Yeung <kcy@codesourcery.com>
Tue, 9 Feb 2021 18:09:02 +0000 (10:09 -0800)
commit7bfdb5a1c694cb9006e0478941e4443b230f5b98
tree99a7c685c86141c868f179707fb0af957d88702a
parent88528328ea560230f728af97110e89396c8267d2
openmp: Fix ICE on non-rectangular loop with known 0 iterations

The loops in the testcase are non-rectangular and have 0 iterations
(the outer loop iterates, but the inner one never).  In this case we
just have the overall number of iterations computed (0), and don't have
factor and other values computed.  We never need to map logical iterations
to the individual iterations in that case, and we were crashing during
expansion of that code.

2020-11-18  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/97862
* omp-expand.c (expand_omp_for_init_vars): Don't use the sqrt path
if number of iterations is constant 0.

* c-c++-common/gomp/pr97862.c: New test.

(cherry picked from commit ba009860aec4619f2424f5bdee812f14572dc3cc)
gcc/ChangeLog.omp
gcc/omp-expand.c
gcc/testsuite/ChangeLog.omp
gcc/testsuite/c-c++-common/gomp/pr97862.c [new file with mode: 0644]