[Bug c/50675] New: master and single OpenMP constructs broken

markflorisson88 at gmail dot com gcc-bugzilla@gcc.gnu.org
Sun Oct 9 12:24:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50675

             Bug #: 50675
           Summary: master and single OpenMP constructs broken
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: markflorisson88@gmail.com


single and master do not work properly in loops. They are either not executed
as often as they should, or the program deadlocks entirely:

#include <stdio.h>

int main(int argc, char **argv) {
    int i;
    #pragma omp parallel
    {
        for (i = 0; i < 10; i++) {
            #pragma omp single
            puts("hello");
        }
    }
    return 0;
}

This program deadlocks in gcc 4.4 and 4.6, whereas in 4.2 is is only executed 4
times (which is the number of cores on my machine). The same goes for the
master construct.



More information about the Gcc-bugs mailing list