public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/55282] New: openmp directive and classes
@ 2012-11-12 10:20 valeryweber at hotmail dot com
  2012-11-12 14:36 ` [Bug fortran/55282] [OOP] " janus at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: valeryweber at hotmail dot com @ 2012-11-12 10:20 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55282

             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. 
The problem seems to be in the class definition of the variable "this" 
(works fine while declared as type).

gcc version 4.8.0 20121112 (experimental) (GCC) 

>>>>>
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=',omp_get_thread_num()
    this%i=2
  end subroutine init
end module mod
program prog
  use mod
  type( my_t ) :: a
!$omp parallel default( none ) & 
!$omp          private( a ) & 
!$omp          num_threads( 4 )
  call init(a)
!$omp end parallel
end program prog
------
gfortran-trunk prog.f90 -fopenmp
bug.f90: In function ‘prog’:
bug.f90:21:0: error: ‘__vtab_mod_My_t’ not specified in enclosing parallel
   call init(a)
 ^
bug.f90:20:0: error: enclosing parallel
 !$omp          num_threads( 4 )
<<<<<<

Thanks
Valery


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/55282] [OOP] openmp directive and classes
  2012-11-12 10:20 [Bug fortran/55282] New: openmp directive and classes valeryweber at hotmail dot com
@ 2012-11-12 14:36 ` janus at gcc dot gnu.org
  2012-11-12 14:47 ` janus at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu.org @ 2012-11-12 14:36 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55282

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |janus at gcc dot gnu.org
            Summary|openmp directive and        |[OOP] openmp directive and
                   |classes                     |classes

--- Comment #1 from janus at gcc dot gnu.org 2012-11-12 14:35:42 UTC ---
(In reply to comment #0)
> The following code doesnt compile at all with the lattest gfortran. 
> The problem seems to be in the class definition of the variable "this" 
> (works fine while declared as type).
>
> [...]
> 
> bug.f90: In function ‘prog’:
> bug.f90:21:0: error: ‘__vtab_mod_My_t’ not specified in enclosing parallel

This is a known problem, see PR 52531.

Note that Fortran 2003 is not supported in OpenMP 3.1. This may change with
OpenMP 4, but I'm not sure of that.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/55282] [OOP] openmp directive and classes
  2012-11-12 10:20 [Bug fortran/55282] New: openmp directive and classes valeryweber at hotmail dot com
  2012-11-12 14:36 ` [Bug fortran/55282] [OOP] " janus at gcc dot gnu.org
@ 2012-11-12 14:47 ` janus at gcc dot gnu.org
  2012-11-12 19:18 ` valeryweber at hotmail dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu.org @ 2012-11-12 14:47 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55282

--- Comment #2 from janus at gcc dot gnu.org 2012-11-12 14:47:11 UTC ---
(In reply to comment #1)
> Note that Fortran 2003 is not supported in OpenMP 3.1. This may change with
> OpenMP 4, but I'm not sure of that.

Just checked: The public RC at http://openmp.org/wp/openmp-specifications/ says
the following:

This OpenMP API specification refers to ISO/IEC 1539-1:2004 as Fortran 2003.
The
following features are not supported:
 * ...
 * Polymorphic entities
 * ...

So, it looks like CLASS declarations are still not allowed in OpenMP 4. Too
bad!


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/55282] [OOP] openmp directive and classes
  2012-11-12 10:20 [Bug fortran/55282] New: openmp directive and classes valeryweber at hotmail dot com
  2012-11-12 14:36 ` [Bug fortran/55282] [OOP] " janus at gcc dot gnu.org
  2012-11-12 14:47 ` janus at gcc dot gnu.org
@ 2012-11-12 19:18 ` valeryweber at hotmail dot com
  2012-11-12 20:02 ` kargl at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: valeryweber at hotmail dot com @ 2012-11-12 19:18 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55282

--- Comment #3 from Valery Weber <valeryweber at hotmail dot com> 2012-11-12 19:18:34 UTC ---
Thanks pointing that. Is there any reason for not allowing the classes in
openmp?
I noticed that other compilers (eg ifort, xlf) can accommodate with this
deviation from the standard, is gfortran going in the same direction?


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/55282] [OOP] openmp directive and classes
  2012-11-12 10:20 [Bug fortran/55282] New: openmp directive and classes valeryweber at hotmail dot com
                   ` (2 preceding siblings ...)
  2012-11-12 19:18 ` valeryweber at hotmail dot com
@ 2012-11-12 20:02 ` kargl at gcc dot gnu.org
  2012-11-13 10:44 ` burnus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: kargl at gcc dot gnu.org @ 2012-11-12 20:02 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55282

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #4 from kargl at gcc dot gnu.org 2012-11-12 20:02:02 UTC ---
(In reply to comment #3)
> Thanks pointing that. Is there any reason for not allowing the classes in
> openmp?
> I noticed that other compilers (eg ifort, xlf) can accommodate with this
> deviation from the standard, is gfortran going in the same direction?

Of course there is a good reason.  What if a future OpenMP
standard introduces classes in manner that conflicts with
the way gfortran implements the extension?  gfortran would
then need an option to toggle between the standard conforming
code and the GNU Fortran extension.  Which, then, is the
default?


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/55282] [OOP] openmp directive and classes
  2012-11-12 10:20 [Bug fortran/55282] New: openmp directive and classes valeryweber at hotmail dot com
                   ` (3 preceding siblings ...)
  2012-11-12 20:02 ` kargl at gcc dot gnu.org
@ 2012-11-13 10:44 ` burnus at gcc dot gnu.org
  2012-11-13 16:57 ` valeryweber at hotmail dot com
  2013-03-17 17:07 ` janus at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-11-13 10:44 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55282

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-11-13 10:44:14 UTC ---
(In reply to comment #1)
> Note that Fortran 2003 is not supported in OpenMP 3.1. This may change with
> OpenMP 4, but I'm not sure of that.

The OpenMP ARB wasn't as active as I had hoped for, cf. "Fortran 2003" in "1.6
Normative References" in the OpenMP 4.0 RC, available at
http://openmp.org/wp/openmp-specifications/  At a glance, it looks as if almost
none of the Fortran 2003 features have been taken care of.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/55282] [OOP] openmp directive and classes
  2012-11-12 10:20 [Bug fortran/55282] New: openmp directive and classes valeryweber at hotmail dot com
                   ` (4 preceding siblings ...)
  2012-11-13 10:44 ` burnus at gcc dot gnu.org
@ 2012-11-13 16:57 ` valeryweber at hotmail dot com
  2013-03-17 17:07 ` janus at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: valeryweber at hotmail dot com @ 2012-11-13 16:57 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55282

--- Comment #6 from Valery Weber <valeryweber at hotmail dot com> 2012-11-13 16:57:28 UTC ---
Dear All 
I posted a comment on the openmp forum about the f2003 features. Complaining
there may help, who knows?
Valery


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/55282] [OOP] openmp directive and classes
  2012-11-12 10:20 [Bug fortran/55282] New: openmp directive and classes valeryweber at hotmail dot com
                   ` (5 preceding siblings ...)
  2012-11-13 16:57 ` valeryweber at hotmail dot com
@ 2013-03-17 17:07 ` janus at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu.org @ 2013-03-17 17:07 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55282

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #7 from janus at gcc dot gnu.org 2013-03-17 17:06:41 UTC ---
resolving as duplicate of PR 52531

*** This bug has been marked as a duplicate of bug 52531 ***


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-03-17 17:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-12 10:20 [Bug fortran/55282] New: openmp directive and classes valeryweber at hotmail dot com
2012-11-12 14:36 ` [Bug fortran/55282] [OOP] " janus at gcc dot gnu.org
2012-11-12 14:47 ` janus at gcc dot gnu.org
2012-11-12 19:18 ` valeryweber at hotmail dot com
2012-11-12 20:02 ` kargl at gcc dot gnu.org
2012-11-13 10:44 ` burnus at gcc dot gnu.org
2012-11-13 16:57 ` valeryweber at hotmail dot com
2013-03-17 17:07 ` janus at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).