This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] Fix invalid GOMP_loop_static_start call (PR middle-end/52230)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 13 Feb 2012 21:01:13 +0100
- Subject: [committed] Fix invalid GOMP_loop_static_start call (PR middle-end/52230)
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
If omp for loop body doesn't fallthru (which doesn't make much sense),
then we would call GOMP_loop_static_start with wrong number of arguments
if collapse is 1, static scheduling without chunk size and no ordered
clause.
Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux,
committed to trunk.
2012-02-13 Jakub Jelinek <jakub@redhat.com>
PR middle-end/52230
* omp-low.c (expand_omp_for): If a static schedule without
chunk size has NULL region->cont, force fd.chunk_size to be
integer_zero_node.
--- gcc/omp-low.c.jj 2012-01-13 21:47:35.000000000 +0100
+++ gcc/omp-low.c 2012-02-13 12:54:55.137590443 +0100
@@ -4664,6 +4664,9 @@ expand_omp_for (struct omp_region *regio
{
int fn_index, start_ix, next_ix;
+ if (fd.chunk_size == NULL
+ && fd.sched_kind == OMP_CLAUSE_SCHEDULE_STATIC)
+ fd.chunk_size = integer_zero_node;
gcc_assert (fd.sched_kind != OMP_CLAUSE_SCHEDULE_AUTO);
fn_index = (fd.sched_kind == OMP_CLAUSE_SCHEDULE_RUNTIME)
? 3 : fd.sched_kind;
Jakub