From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1932 invoked by alias); 25 Jan 2010 21:39:07 -0000 Received: (qmail 1883 invoked by uid 48); 25 Jan 2010 21:38:57 -0000 Date: Mon, 25 Jan 2010 21:39:00 -0000 Subject: [Bug fortran/42866] New: ICE for REDUCTION with ALLOCATABLE array as variable on SECTIONS X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "longb at cray dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-01/txt/msg02912.txt.bz2 For this test case: program F03_2_9_3_6_2c ! derived from OpenMP test omp3f/F03_2_9_3_6_2c.f90 ! REFERENCES ! OpenMP 3.0, p. 100, lines 10-12 ! OpenMP 3.0, p. 316, lines 18-22 use omp_lib implicit none integer, parameter :: NT = 4 integer :: thread_num1, thread_num2, thread_num3 integer, allocatable :: thread_num_sums(:) integer :: i call omp_set_dynamic(.false.) call omp_set_num_threads(NT) allocate(thread_num_sums(NT)) thread_num_sums = 0 !$omp parallel !$omp sections reduction(+:thread_num_sums) !$omp section thread_num_sums = omp_get_thread_num() thread_num1 = omp_get_thread_num() !$omp section thread_num_sums = omp_get_thread_num() thread_num2 = omp_get_thread_num() !$omp section thread_num_sums = omp_get_thread_num() thread_num3 = omp_get_thread_num() !$omp end sections !$omp end parallel do i = 1, NT if (thread_num_sums(i) /= thread_num1+thread_num2+thread_num3) then write (*,fmt="('FAIL - thread_num_sums(',i2, ') == ',i10, & ' (expected',i2,')')") & i, thread_num_sums(i), thread_num1+thread_num2+thread_num3 else write (*,fmt="('thread',i2,' thread_num_sums(i) = ',i2)") & i, thread_num_sums(i) end if end do end program F03_2_9_3_6_2c the compiler aborts: > gfortran -fopenmp test.f90 test.f90: In function 'f03_2_9_3_6_2c': test.f90:20: internal compiler error: in single_pred_edge, at basic-block.h:658 Please submit a full bug report, with preprocessed source if appropriate. Additional comment from the OpenMP testers: The GNU gfortran compiler gets an internal error when compiling this test case when the REDUCTION appears on a SECTIONS. The OpenMP API version 3 (May 2008) p. 316 lines 18-20 states: "In Version 3.0, Fortran allocatable arrays may appear in ... reduction ... clauses." The API also states on p. 100 line 10-23: "An original list item with the ALLOCATABLE attribute must be in the allocated state at entry to the construct containing the reduction clause. Additionally, the list item must not be deallocated and/or allocated within the region." -- Summary: ICE for REDUCTION with ALLOCATABLE array as variable on SECTIONS Product: gcc Version: 4.4.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: longb at cray dot com GCC build triplet: x86_64-suse-linux GCC host triplet: x86_64-suse-linux GCC target triplet: x86_64-suse-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42866