From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25985 invoked by alias); 24 Feb 2006 14:22:08 -0000 Received: (qmail 25972 invoked by uid 48); 24 Feb 2006 14:22:05 -0000 Date: Fri, 24 Feb 2006 14:23:00 -0000 Subject: [Bug c/26456] New: OpenMP program deadlocks when executed X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "eloranta at jyu dot fi" 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: 2006-02/txt/msg02806.txt.bz2 List-Id: OpenMP C programs deadlock immediately after starting when OMP_NUM_THREADS is > 1. For example, the following simple code just hangs: #include main() { int i; #pragma omp parallel for private(i) for (i = 0; i < 100; i++) printf("Thread = %d.\n", omp_get_thread_num()); } This occurs on MacOS X 10.4.5 with gcc version: Using built-in specs. Target: powerpc-apple-darwin8.4.0 Configured with: /opt/local/var/db/dports/build/_opt_local_var_db_dports_sources_rsync.rsync.darwinports.org_dpupdate_dports_lang_gcc42/work/gcc-4.2-20060204/configure --prefix=/opt/local --enable-languages=c,c++,java,objc,fortran --libdir=/opt/local/lib/gcc42 --includedir=/opt/local/include/gcc42 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-dp-4.2 --with-gxx-include-dir=/opt/local/include/gcc42/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --disable-multilib Thread model: posix gcc version 4.2.0 20060204 (experimental) Also it appears that when -fopenmp switch is used, gcc does not automatically include -lgomp but this has to be done by hand. -- Summary: OpenMP program deadlocks when executed Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: eloranta at jyu dot fi http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26456