From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17859 invoked by alias); 5 Dec 2005 10:57:51 -0000 Received: (qmail 17843 invoked by uid 48); 5 Dec 2005 10:57:49 -0000 Date: Mon, 05 Dec 2005 10:57:00 -0000 Subject: [Bug middle-end/25261] New: [gomp] Nested function calls in #pragma omp parallel blocks X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jakub at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2005-12/txt/msg00440.txt.bz2 List-Id: As mentioned in my http://gcc.gnu.org/ml/gcc-patches/2005-12/msg00035.html mail, nested function calls in #pragma omp parallel blocks are still broken (for all of C/C++/Fortran and at least in Fortran they are part of the standards) and I'm even not sure what the exact semantics should be for them if e.g. some of the variables the nested fns refer to are privatized in the parallel and some are not. Below is just a short testcase, we'll need several more testcases to cover this when it is actually fixed. /* { dg-do run } */ #include extern void abort (void); int main (void) { int i = 5, j, l = 0; int foo (void) { return i == 6; } int bar (void) { return i - 3; } omp_set_dynamic (0); #pragma omp parallel for schedule (static, bar ()) num_threads (2) \ reduction (|:l) for (j = 0; j < 4; j++) if (omp_get_thread_num () != (j < 2)) l = 1; i++; #pragma omp parallel for schedule (static, bar ()) num_threads (2) \ reduction (|:l) for (j = 0; j < 6; j++) if (omp_get_thread_num () != (j < 3)) l = 1; #pragma omp parallel num_threads (4) reduction (|:l) if (! foo () || bar () != 3) l = 1; i++; #pragma omp parallel num_threads (4) reduction (|:l) if (foo () || bar () != 4) l = 1; if (l) abort (); return 0; } -- Summary: [gomp] Nested function calls in #pragma omp parallel blocks Product: gcc Version: 4.1.0 Status: UNCONFIRMED Keywords: openmp Severity: normal Priority: P3 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jakub at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25261