public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/34760]  New: PRIVATE variable not allowed as STAT variable in ALLOCATE
@ 2008-01-12 20:54 dick dot hendrickson at gmail dot com
  2008-01-12 21:14 ` [Bug fortran/34760] " burnus at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: dick dot hendrickson at gmail dot com @ 2008-01-12 20:54 UTC (permalink / raw)
  To: gcc-bugs

With gfortran 4.3.0 20080109 I get the error message

     ALLOCATE (RLA1(NF10), STAT = ISTAT)
                                      1
Error: STAT expression at (1) must be a variable

With the following program.

     MODULE TESTS
     INTEGER, PRIVATE :: ISTAT       !this one FAILS
!      INTEGER :: ISTAT               !this one works
!      PRIVATE :: ISTAT               !this one FAILS
     CONTAINS
     SUBROUTINE AD0001
     REAL RLA1(:)
     ALLOCATABLE RLA1
     ISTAT = -314
     ALLOCATE (RLA1(NF10), STAT = ISTAT)
     END SUBROUTINE
     END MODULE

In the real module there are several subroutines that do similar
allocates and they do not generate the error.  It looks like it is
only the first use of ISTAT in an allocate that triggers the message.

Dick Hendrickson


-- 
           Summary: PRIVATE variable not allowed as STAT variable in
                    ALLOCATE
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dick dot hendrickson at gmail dot com


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


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

* [Bug fortran/34760] PRIVATE variable not allowed as STAT variable in ALLOCATE
  2008-01-12 20:54 [Bug fortran/34760] New: PRIVATE variable not allowed as STAT variable in ALLOCATE dick dot hendrickson at gmail dot com
@ 2008-01-12 21:14 ` burnus at gcc dot gnu dot org
  2008-01-13  1:22 ` burnus at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-12 21:14 UTC (permalink / raw)
  To: gcc-bugs



-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |32834
              nThis|                            |
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |rejects-valid
   Last reconfirmed|0000-00-00 00:00:00         |2008-01-12 20:59:27
               date|                            |


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


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

* [Bug fortran/34760] PRIVATE variable not allowed as STAT variable in ALLOCATE
  2008-01-12 20:54 [Bug fortran/34760] New: PRIVATE variable not allowed as STAT variable in ALLOCATE dick dot hendrickson at gmail dot com
  2008-01-12 21:14 ` [Bug fortran/34760] " burnus at gcc dot gnu dot org
@ 2008-01-13  1:22 ` burnus at gcc dot gnu dot org
  2008-01-14  0:43 ` burnus at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-13  1:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from burnus at gcc dot gnu dot org  2008-01-12 22:49 -------
DEALLOCATE has actually the same problem.

Regarding gfc_match_allocate/gfc_match_deallocate:
a) "if (stat->symtree->n.sym->attr.flavor != FL_VARIABLE)" is false as the
flavor is FL_UNKNOWN.
b) ALLOCATE has much more checks for "stat" being a variable than DEALLOCATE, I
had expected that they have the same checks for STAT.


-- 


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


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

* [Bug fortran/34760] PRIVATE variable not allowed as STAT variable in ALLOCATE
  2008-01-12 20:54 [Bug fortran/34760] New: PRIVATE variable not allowed as STAT variable in ALLOCATE dick dot hendrickson at gmail dot com
  2008-01-12 21:14 ` [Bug fortran/34760] " burnus at gcc dot gnu dot org
  2008-01-13  1:22 ` burnus at gcc dot gnu dot org
@ 2008-01-14  0:43 ` burnus at gcc dot gnu dot org
  2008-01-14  0:56 ` [Bug fortran/34760] [4.3 Regression] " burnus at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-14  0:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from burnus at gcc dot gnu dot org  2008-01-13 22:49 -------
match_variable is called for "istat" in the subroutine. For the first match, it
is FL_UNKNOWN and then - without PRIVATE - it is set to FL_VARIABLE. With
public/private, it remains FL_UNKNOWN.

As for ALLOCATE sym->attr.flavor == FL_VARIABLE is check, it fails therefore as
soon as the variable has been marked as public/private.

match_variable contains:

  switch (sym->attr.flavor)
    {
[...]
    case FL_UNKNOWN:
      if (sym->attr.access == ACCESS_PUBLIC
          || sym->attr.access == ACCESS_PRIVATE)
        break;
      if (gfc_add_flavor (&sym->attr, FL_VARIABLE,
                          sym->name, NULL) == FAILURE)
        return MATCH_ERROR;
      break;


-- 


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


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

* [Bug fortran/34760] [4.3 Regression] PRIVATE variable not allowed as STAT variable in ALLOCATE
  2008-01-12 20:54 [Bug fortran/34760] New: PRIVATE variable not allowed as STAT variable in ALLOCATE dick dot hendrickson at gmail dot com
                   ` (2 preceding siblings ...)
  2008-01-14  0:43 ` burnus at gcc dot gnu dot org
@ 2008-01-14  0:56 ` burnus at gcc dot gnu dot org
  2008-01-17 22:46 ` burnus at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-14  0:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from burnus at gcc dot gnu dot org  2008-01-13 22:57 -------
Regression, caused by the fix for PR 32760.


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.3.0
      Known to work|                            |4.2.2 4.1.3
            Summary|PRIVATE variable not allowed|[4.3 Regression] PRIVATE
                   |as STAT variable in ALLOCATE|variable not allowed as STAT
                   |                            |variable in ALLOCATE


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


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

* [Bug fortran/34760] [4.3 Regression] PRIVATE variable not allowed as STAT variable in ALLOCATE
  2008-01-12 20:54 [Bug fortran/34760] New: PRIVATE variable not allowed as STAT variable in ALLOCATE dick dot hendrickson at gmail dot com
                   ` (3 preceding siblings ...)
  2008-01-14  0:56 ` [Bug fortran/34760] [4.3 Regression] " burnus at gcc dot gnu dot org
@ 2008-01-17 22:46 ` burnus at gcc dot gnu dot org
  2008-01-19 16:04 ` burnus at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-17 22:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from burnus at gcc dot gnu dot org  2008-01-17 22:32 -------
I have a patch, which needs to be regression tested. Watch this place!


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |burnus at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-01-12 20:59:27         |2008-01-17 22:32:20
               date|                            |


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


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

* [Bug fortran/34760] [4.3 Regression] PRIVATE variable not allowed as STAT variable in ALLOCATE
  2008-01-12 20:54 [Bug fortran/34760] New: PRIVATE variable not allowed as STAT variable in ALLOCATE dick dot hendrickson at gmail dot com
                   ` (4 preceding siblings ...)
  2008-01-17 22:46 ` burnus at gcc dot gnu dot org
@ 2008-01-19 16:04 ` burnus at gcc dot gnu dot org
  2008-01-19 17:13 ` burnus at gcc dot gnu dot org
  2008-01-19 17:22 ` burnus at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-19 16:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from burnus at gcc dot gnu dot org  2008-01-19 14:16 -------
Patch: http://gcc.gnu.org/ml/fortran/2008-01/msg00236.html


-- 


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


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

* [Bug fortran/34760] [4.3 Regression] PRIVATE variable not allowed as STAT variable in ALLOCATE
  2008-01-12 20:54 [Bug fortran/34760] New: PRIVATE variable not allowed as STAT variable in ALLOCATE dick dot hendrickson at gmail dot com
                   ` (5 preceding siblings ...)
  2008-01-19 16:04 ` burnus at gcc dot gnu dot org
@ 2008-01-19 17:13 ` burnus at gcc dot gnu dot org
  2008-01-19 17:22 ` burnus at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-19 17:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from burnus at gcc dot gnu dot org  2008-01-19 15:41 -------
Subject: Bug 34760

Author: burnus
Date: Sat Jan 19 15:41:04 2008
New Revision: 131652

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131652
Log:
2008-01-19  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34760
        * primary.c (match_variable): Handle FL_UNKNOWN without
        uneducated guessing.
        (match_variable): Improve error message.

2008-01-19  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34760
        * gfortran.dg/implicit_11.f90: New.
        * gfortran.dg/allocate_stat.f90: Update dg-error pattern.
        * gfortran.dg/entry_15.f90: Ditto.
        * gfortran.dg/func_assign.f90: Ditto.
        * gfortran.dg/gomp/reduction3.f90: Ditto.
        * gfortran.dg/proc_assign_1.f90: Ditto.

        * gfortran.dg/interface_proc_end.f90: Use dg-error instead
        of dg-excess-errors.


Added:
    trunk/gcc/testsuite/gfortran.dg/implicit_11.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/primary.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/allocate_stat.f90
    trunk/gcc/testsuite/gfortran.dg/entry_15.f90
    trunk/gcc/testsuite/gfortran.dg/func_assign.f90
    trunk/gcc/testsuite/gfortran.dg/gomp/reduction3.f90
    trunk/gcc/testsuite/gfortran.dg/interface_proc_end.f90
    trunk/gcc/testsuite/gfortran.dg/proc_assign_1.f90


-- 


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


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

* [Bug fortran/34760] [4.3 Regression] PRIVATE variable not allowed as STAT variable in ALLOCATE
  2008-01-12 20:54 [Bug fortran/34760] New: PRIVATE variable not allowed as STAT variable in ALLOCATE dick dot hendrickson at gmail dot com
                   ` (6 preceding siblings ...)
  2008-01-19 17:13 ` burnus at gcc dot gnu dot org
@ 2008-01-19 17:22 ` burnus at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-01-19 17:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from burnus at gcc dot gnu dot org  2008-01-19 17:13 -------
FIXED on the trunk (4.3.0).

Thanks for the bug report.


-- 

burnus at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2008-01-19 17:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-12 20:54 [Bug fortran/34760] New: PRIVATE variable not allowed as STAT variable in ALLOCATE dick dot hendrickson at gmail dot com
2008-01-12 21:14 ` [Bug fortran/34760] " burnus at gcc dot gnu dot org
2008-01-13  1:22 ` burnus at gcc dot gnu dot org
2008-01-14  0:43 ` burnus at gcc dot gnu dot org
2008-01-14  0:56 ` [Bug fortran/34760] [4.3 Regression] " burnus at gcc dot gnu dot org
2008-01-17 22:46 ` burnus at gcc dot gnu dot org
2008-01-19 16:04 ` burnus at gcc dot gnu dot org
2008-01-19 17:13 ` burnus at gcc dot gnu dot org
2008-01-19 17:22 ` burnus 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).