From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17500 invoked by alias); 22 Feb 2006 10:28:10 -0000 Received: (qmail 17492 invoked by uid 48); 22 Feb 2006 10:28:07 -0000 Date: Wed, 22 Feb 2006 10:28:00 -0000 Subject: [Bug c/26412] New: Problem with OpenMP / C 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/msg02496.txt.bz2 List-Id: The following code causes gcc to crash when openmp is enabled: bug2.c: /* * This program triggers an openmp bug in gcc 4.2: Using built-in specs. Target: powerpc-apple-darwin8.4.0 Configured with: /opt/local/var/db/dports/build/_opt_local_var_db_dports_sour ces_rsync.rsync.darwinports.org_dpupdate_dports_lang_gcc42/work/gcc-4.2-20060 204/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-i nclude-dir=/opt/local/include/gcc42/c++/ --with-gmp=/opt/local --with-mpfr=/o pt/local --disable-multilib Thread model: posix gcc version 4.2.0 20060204 (experimental) * * * To compile: * * gcc -fopenmp -c bug2.c * * The resulting error message is: * bug2.c: In function 'test': bug2.c:34: internal compiler error: Bus error Please submit a full bug report, with preprocessed source if appropriate. See for instructions. * * The program compiles without the -fopenmp flag. * * The system is MacOS X 10.4.5. * * Note: the program does nothing useful (it just for demonstrating the problem) * */ extern double table_h[]; extern int dft_model; void test() { int ri; double ph; #pragma omp parallel for private(ri) for (ri = 0; ri < 100; ri++) { ph = table_h[dft_model]; } } bug2.i: # 1 "bug2.c" # 1 "" # 1 "" # 1 "bug2.c" # 26 "bug2.c" extern double table_h[]; extern int dft_model; void test() { int ri; double ph; #pragma omp parallel for private(ri) for (ri = 0; ri < 100; ri++) { ph = table_h[dft_model]; } } -- Summary: Problem with OpenMP / C Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: major 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=26412