public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/52652] New: call to gfc_match_asynchronous for allocatable at parse.c line 164
@ 2012-03-21 10:05 bugzillamail at ameshymn dot org
  2012-03-21 13:24 ` [Bug fortran/52652] " burnus at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: bugzillamail at ameshymn dot org @ 2012-03-21 10:05 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52652
           Summary: call to gfc_match_asynchronous for allocatable at
                    parse.c line 164
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: bugzillamail@ameshymn.org


parse.c line 164:

Is:
      match ("allocatable", gfc_match_asynchronous, ST_ATTR_DECL);

Should be?

      match ("allocatable", gfc_match_allocatable, ST_ATTR_DECL);


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

* [Bug fortran/52652] call to gfc_match_asynchronous for allocatable at parse.c line 164
  2012-03-21 10:05 [Bug fortran/52652] New: call to gfc_match_asynchronous for allocatable at parse.c line 164 bugzillamail at ameshymn dot org
@ 2012-03-21 13:24 ` burnus at gcc dot gnu.org
  2012-03-28 20:51 ` pault at gcc dot gnu.org
  2012-03-28 20:57 ` pault at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-03-21 13:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-03-21
                 CC|                            |burnus at gcc dot gnu.org
     Ever Confirmed|0                           |1

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-03-21 13:21:35 UTC ---
Confirmed - and well spotted. Thanks for the bug report!

 * * *

The code has been added for PR 25829 comment 16 (Rev. 155732), however, it
wasn't working before either - thus, it is not a regression. (I had an example
to test the parsing in the patch submittal - but as  I didn't use "allocate()"
it "successfully" compiled.)

 * * *

Test case: It's valid, but rejected with
  Error: Allocate-object at (1) is not a nonprocedure pointer
         or an allocatable variable


module m
  type t
  end type t
end module m

type(t) function bar()
  use m
  allocatable :: bar
  allocate (bar)
end

Untested patch:

--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -3574,4 +3574,4 @@ gfc_match_allocate (void)
        {
-         gfc_error ("Allocate-object at %L is not a nonprocedure pointer "
-                    "or an allocatable variable", &tail->expr->where);
+         gfc_error ("Allocate-object at %L is neither a nonprocedure pointer "
+                    "nor an allocatable variable", &tail->expr->where);
          goto cleanup;
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -163,3 +163,3 @@ decode_specification_statement (void)
             ST_INTERFACE);
-      match ("allocatable", gfc_match_asynchronous, ST_ATTR_DECL);
+      match ("allocatable", gfc_match_allocatable, ST_ATTR_DECL);
       match ("asynchronous", gfc_match_asynchronous, ST_ATTR_DECL);

--- a/gcc/testsuite/gfortran.dg/allocate_alloc_opt_1.f90
+++ b/gcc/testsuite/gfortran.dg/allocate_alloc_opt_1.f90
@@ -27 +27 @@ program a
-  allocate(err) ! { dg-error "nonprocedure pointer or an allocatable" }
+  allocate(err) ! { dg-error "neither a nonprocedure pointer nor an
allocatable" }
--- a/gcc/testsuite/gfortran.dg/allocate_class_1.f90
+++ b/gcc/testsuite/gfortran.dg/allocate_class_1.f90
@@ -10 +10 @@
- allocate(x)     ! { dg-error "is not a nonprocedure pointer or an allocatable
variable" }
+ allocate(x)     ! { dg-error "is neither a nonprocedure pointer nor an
allocatable variable" }
--- a/gcc/testsuite/gfortran.dg/allocate_with_typespec_4.f90
+++ b/gcc/testsuite/gfortran.dg/allocate_with_typespec_4.f90
@@ -24 +24 @@ subroutine not_an_f03_intrinsic
-   allocate(double complex :: d1) ! { dg-error "not a nonprocedure pointer or
an allocatable" }
+   allocate(double complex :: d1) ! { dg-error "neither a nonprocedure pointer
nor an allocatable" }
--- a/gcc/testsuite/gfortran.dg/deallocate_alloc_opt_1.f90
+++ b/gcc/testsuite/gfortran.dg/deallocate_alloc_opt_1.f90
@@ -27 +27 @@ program a
-  deallocate(err) ! { dg-error "nonprocedure pointer or an allocatable" }
+  deallocate(err) ! { dg-error "nonprocedure pointer nor an allocatable" }


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

* [Bug fortran/52652] call to gfc_match_asynchronous for allocatable at parse.c line 164
  2012-03-21 10:05 [Bug fortran/52652] New: call to gfc_match_asynchronous for allocatable at parse.c line 164 bugzillamail at ameshymn dot org
  2012-03-21 13:24 ` [Bug fortran/52652] " burnus at gcc dot gnu.org
@ 2012-03-28 20:51 ` pault at gcc dot gnu.org
  2012-03-28 20:57 ` pault at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pault at gcc dot gnu.org @ 2012-03-28 20:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Paul Thomas <pault at gcc dot gnu.org> 2012-03-28 20:45:30 UTC ---
Author: pault
Date: Wed Mar 28 20:45:16 2012
New Revision: 185924

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=185924
Log:
2012-03-28  Paul Thomas  <pault@gcc.gnu.org>
    Tobias Burnus  <burnus@gcc.gnu.org>

    PR fortran/52652
    * match.c (gfc_match_allocate, gfc_match_deallocate): Change
    "not.. or" to "neither.. nor".
    * parse.c (decode_specification_statement): Correct error in
    chpice of matching function for "allocatable". 

2012-03-28  Paul Thomas  <pault@gcc.gnu.org>
    Tobias Burnus  <burnus@gcc.gnu.org>

    PR fortran/52652
    * gfortran.dg/allocate_class_1.f90 : Change error test.
    * gfortran.dg/allocate_with_typespec_4.f90 : Change error test.
    * gfortran.dg/allocate_alloc_opt_1.f90 : Change error test.
    * gfortran.dg/deallocate_alloc_opt_1.f90 : Change error test.


Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/match.c
    trunk/gcc/fortran/parse.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/allocate_alloc_opt_1.f90
    trunk/gcc/testsuite/gfortran.dg/allocate_class_1.f90
    trunk/gcc/testsuite/gfortran.dg/allocate_with_typespec_4.f90
    trunk/gcc/testsuite/gfortran.dg/deallocate_alloc_opt_1.f90


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

* [Bug fortran/52652] call to gfc_match_asynchronous for allocatable at parse.c line 164
  2012-03-21 10:05 [Bug fortran/52652] New: call to gfc_match_asynchronous for allocatable at parse.c line 164 bugzillamail at ameshymn dot org
  2012-03-21 13:24 ` [Bug fortran/52652] " burnus at gcc dot gnu.org
  2012-03-28 20:51 ` pault at gcc dot gnu.org
@ 2012-03-28 20:57 ` pault at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pault at gcc dot gnu.org @ 2012-03-28 20:57 UTC (permalink / raw)
  To: gcc-bugs

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

Paul Thomas <pault at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |pault at gcc dot gnu.org
         Resolution|                            |FIXED

--- Comment #3 from Paul Thomas <pault at gcc dot gnu.org> 2012-03-28 20:51:02 UTC ---
Thanks for the good call, Brian!

Fixed on trunk

Paul


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

end of thread, other threads:[~2012-03-28 20:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-21 10:05 [Bug fortran/52652] New: call to gfc_match_asynchronous for allocatable at parse.c line 164 bugzillamail at ameshymn dot org
2012-03-21 13:24 ` [Bug fortran/52652] " burnus at gcc dot gnu.org
2012-03-28 20:51 ` pault at gcc dot gnu.org
2012-03-28 20:57 ` pault 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).