public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/35786]  New: OpenMP Fortran PRIVATE on parameter gives error in gfc_finish_var_decl
@ 2008-04-01  8:10 J dot Hogg at rl dot ac dot uk
  2008-04-01 13:23 ` [Bug fortran/35786] " burnus at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: J dot Hogg at rl dot ac dot uk @ 2008-04-01  8:10 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1594 bytes --]

Using the parameter ONE in the PRIVATE stanza of the parallel do in the below
code produces the shown error. This error only occurs if the subroutine is in a
module file.

user@host $ gfortran-4.3 -fopenmp -c test.f90
test.f90: In function ‘test’:
test.f90:8: internal compiler error: in gfc_finish_var_decl, at
fortran/trans-decl.c:510
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
user@host $ cat test.f90
module testmod
  implicit none

  real, parameter :: one = 1.0

contains

subroutine test
    integer i

    real, dimension(4) :: a = (/ 1, 2, 3, 4 /)
    real, dimension(4) :: b

    !$OMP PARALLEL DO PRIVATE(I, ONE)
    do i = 1,size(a)
      b(i) = one*a(i)
    end do
    !$OMP END PARALLEL DO

    print *, "b = ", b
end subroutine test
end module
user@host $ gfortran-4.3 -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --program-suffix=-4.3
Thread model: posix
gcc version 4.3.0 (GCC)


-- 
           Summary: OpenMP Fortran PRIVATE on parameter gives error in
                    gfc_finish_var_decl
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: J dot Hogg at rl dot ac dot uk
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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


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

* [Bug fortran/35786] OpenMP Fortran PRIVATE on parameter gives error in gfc_finish_var_decl
  2008-04-01  8:10 [Bug fortran/35786] New: OpenMP Fortran PRIVATE on parameter gives error in gfc_finish_var_decl J dot Hogg at rl dot ac dot uk
@ 2008-04-01 13:23 ` burnus at gcc dot gnu dot org
  2008-04-01 14:14 ` J dot Hogg at rl dot ac dot uk
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-04-01 13:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from burnus at gcc dot gnu dot org  2008-04-01 13:22 -------
Thanks for the report; the internal compiler error is definitely a compiler
bug. However, I believe the program is invalid.

If I read "2.8.3.3 private clause" in the OpenMP 2.5 specification correctly,
the items in the private(list) need to variables which are definable or
allocatable. However, "ONE" is not even a variable. Thus the program is
invalid. However, an error message such as the one of sunf95 should be given
instead of an ICE.


sunf95 writes:
    !$OMP PARALLEL DO PRIVATE(I, ONE)
                                 ^
"dfff.f90", Line = 14, Column = 34: ERROR: Object ONE must be a variable to be
in the PRIVATE clause of the PARALLEL DO directive.

ifort writes:
    !$OMP PARALLEL DO PRIVATE(I, ONE)
---------------------------------^
fortcom: Error: dfff.f90, line 14: Subobjects are not allowed in this OpenMP
clause; a named variable must be specified.


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |diagnostic, ice-on-invalid-
                   |                            |code, openmp
   Last reconfirmed|0000-00-00 00:00:00         |2008-04-01 13:22:13
               date|                            |


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


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

* [Bug fortran/35786] OpenMP Fortran PRIVATE on parameter gives error in gfc_finish_var_decl
  2008-04-01  8:10 [Bug fortran/35786] New: OpenMP Fortran PRIVATE on parameter gives error in gfc_finish_var_decl J dot Hogg at rl dot ac dot uk
  2008-04-01 13:23 ` [Bug fortran/35786] " burnus at gcc dot gnu dot org
@ 2008-04-01 14:14 ` J dot Hogg at rl dot ac dot uk
  2008-04-03 14:58 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: J dot Hogg at rl dot ac dot uk @ 2008-04-01 14:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from J dot Hogg at rl dot ac dot uk  2008-04-01 14:13 -------
(In reply to comment #1)
> Thanks for the report; the internal compiler error is definitely a compiler
> bug. However, I believe the program is invalid.

I know the program is invalid (thought that went without saying, I should
probably be more verbose in the future), it was more of a feature request for a
nice error message.

Thanks for your help,
Jonathan.


-- 


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


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

* [Bug fortran/35786] OpenMP Fortran PRIVATE on parameter gives error in gfc_finish_var_decl
  2008-04-01  8:10 [Bug fortran/35786] New: OpenMP Fortran PRIVATE on parameter gives error in gfc_finish_var_decl J dot Hogg at rl dot ac dot uk
  2008-04-01 13:23 ` [Bug fortran/35786] " burnus at gcc dot gnu dot org
  2008-04-01 14:14 ` J dot Hogg at rl dot ac dot uk
@ 2008-04-03 14:58 ` jakub at gcc dot gnu dot org
  2008-04-03 21:02 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-04-03 14:58 UTC (permalink / raw)
  To: gcc-bugs



-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2008-
                   |                            |04/msg00269.html
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-04-01 13:22:13         |2008-04-03 14:57:20
               date|                            |


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


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

* [Bug fortran/35786] OpenMP Fortran PRIVATE on parameter gives error in gfc_finish_var_decl
  2008-04-01  8:10 [Bug fortran/35786] New: OpenMP Fortran PRIVATE on parameter gives error in gfc_finish_var_decl J dot Hogg at rl dot ac dot uk
                   ` (2 preceding siblings ...)
  2008-04-03 14:58 ` jakub at gcc dot gnu dot org
@ 2008-04-03 21:02 ` jakub at gcc dot gnu dot org
  2008-04-03 21:22 ` jakub at gcc dot gnu dot org
  2008-04-03 21:26 ` jakub at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-04-03 21:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jakub at gcc dot gnu dot org  2008-04-03 21:02 -------
Subject: Bug 35786

Author: jakub
Date: Thu Apr  3 21:01:26 2008
New Revision: 133874

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133874
Log:
        PR fortran/35786
        * openmp.c (resolve_omp_clauses): Diagnose if a clause symbol
        isn't a variable.

        * gfortran.dg/gomp/pr35786-1.f90: New test.
        * gfortran.dg/gomp/pr35786-2.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/gomp/pr35786-1.f90
    trunk/gcc/testsuite/gfortran.dg/gomp/pr35786-2.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/openmp.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/35786] OpenMP Fortran PRIVATE on parameter gives error in gfc_finish_var_decl
  2008-04-01  8:10 [Bug fortran/35786] New: OpenMP Fortran PRIVATE on parameter gives error in gfc_finish_var_decl J dot Hogg at rl dot ac dot uk
                   ` (3 preceding siblings ...)
  2008-04-03 21:02 ` jakub at gcc dot gnu dot org
@ 2008-04-03 21:22 ` jakub at gcc dot gnu dot org
  2008-04-03 21:26 ` jakub at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-04-03 21:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jakub at gcc dot gnu dot org  2008-04-03 21:21 -------
Subject: Bug 35786

Author: jakub
Date: Thu Apr  3 21:20:53 2008
New Revision: 133877

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133877
Log:
        PR fortran/35786
        * openmp.c (resolve_omp_clauses): Diagnose if a clause symbol
        isn't a variable.

        * gfortran.dg/gomp/pr35786-1.f90: New test.
        * gfortran.dg/gomp/pr35786-2.f90: New test.

Added:
    branches/gcc-4_3-branch/gcc/testsuite/gfortran.dg/gomp/pr35786-1.f90
    branches/gcc-4_3-branch/gcc/testsuite/gfortran.dg/gomp/pr35786-2.f90
Modified:
    branches/gcc-4_3-branch/gcc/fortran/ChangeLog
    branches/gcc-4_3-branch/gcc/fortran/openmp.c
    branches/gcc-4_3-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/35786] OpenMP Fortran PRIVATE on parameter gives error in gfc_finish_var_decl
  2008-04-01  8:10 [Bug fortran/35786] New: OpenMP Fortran PRIVATE on parameter gives error in gfc_finish_var_decl J dot Hogg at rl dot ac dot uk
                   ` (4 preceding siblings ...)
  2008-04-03 21:22 ` jakub at gcc dot gnu dot org
@ 2008-04-03 21:26 ` jakub at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-04-03 21:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jakub at gcc dot gnu dot org  2008-04-03 21:25 -------
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2008-04-03 21:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-01  8:10 [Bug fortran/35786] New: OpenMP Fortran PRIVATE on parameter gives error in gfc_finish_var_decl J dot Hogg at rl dot ac dot uk
2008-04-01 13:23 ` [Bug fortran/35786] " burnus at gcc dot gnu dot org
2008-04-01 14:14 ` J dot Hogg at rl dot ac dot uk
2008-04-03 14:58 ` jakub at gcc dot gnu dot org
2008-04-03 21:02 ` jakub at gcc dot gnu dot org
2008-04-03 21:22 ` jakub at gcc dot gnu dot org
2008-04-03 21:26 ` jakub at gcc dot gnu dot 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).