From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26811 invoked by alias); 12 Nov 2012 10:20:06 -0000 Received: (qmail 26621 invoked by uid 48); 12 Nov 2012 10:19:52 -0000 From: "valeryweber at hotmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/55282] New: openmp directive and classes Date: Mon, 12 Nov 2012 10:20:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: valeryweber at hotmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: 2012-11/txt/msg00997.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D55282 Bug #: 55282 Summary: openmp directive and classes Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: valeryweber@hotmail.com Dear All The following code doesnt compile at all with the lattest gfortran.=20 The problem seems to be in the class definition of the variable "this"=20 (works fine while declared as type). gcc version 4.8.0 20121112 (experimental) (GCC)=20 >>>>> module mod use omp_lib type :: my_t integer :: i end type my_t contains subroutine init( this ) class( my_t ) :: this ! type( my_t ) :: this write(*,*) 'init thread=3D',omp_get_thread_num() this%i=3D2 end subroutine init end module mod program prog use mod type( my_t ) :: a !$omp parallel default( none ) &=20 !$omp private( a ) &=20 !$omp num_threads( 4 ) call init(a) !$omp end parallel end program prog ------ gfortran-trunk prog.f90 -fopenmp bug.f90: In function =E2=80=98prog=E2=80=99: bug.f90:21:0: error: =E2=80=98__vtab_mod_My_t=E2=80=99 not specified in enc= losing parallel call init(a) ^ bug.f90:20:0: error: enclosing parallel !$omp num_threads( 4 ) <<<<<< Thanks Valery