This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] Fix invalid GOMP_loop_static_start call (PR middle-end/52230)


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

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux,
committed to trunk.

2012-02-13  Jakub Jelinek  <>

	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

--- 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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]