]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR middle-end/52230 (OpenMP: Simple C program triggers SIGSEGV at execution)
authorJakub Jelinek <jakub@redhat.com>
Tue, 14 Feb 2012 23:32:39 +0000 (00:32 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 14 Feb 2012 23:32:39 +0000 (00:32 +0100)
Backported from mainline
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.

From-SVN: r184240

gcc/ChangeLog
gcc/omp-low.c

index 698804e460c2c31652e6c8241a504e5f04cde0e0..1ba4443d3b833ea7498b3ee88ab2afcc3394aebb 100644 (file)
@@ -1,5 +1,13 @@
 2012-02-14  Jakub Jelinek  <jakub@redhat.com>
 
+       Backported from mainline
+       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.
+
        PR bootstrap/51969
        Backported from mainline
        2011-11-08  Michael Matz  <matz@suse.de>
index 364f51e3bfd66893447b0168b76d07e51f134101..bb0017a7671336df87da7fe0d2149abca739f80d 100644 (file)
@@ -4618,6 +4618,9 @@ expand_omp_for (struct omp_region *region)
     {
       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;