public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/55314] New: [4.6/4.7/4.8 Regression] Rejects some valid ALLOCATE statements
@ 2012-11-13 22:35 tkoenig at gcc dot gnu.org
  2012-11-13 22:39 ` [Bug fortran/55314] " tkoenig at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2012-11-13 22:35 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55314
           Summary: [4.6/4.7/4.8 Regression] Rejects some valid ALLOCATE
                    statements
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tkoenig@gcc.gnu.org


Test case by Jacob Weisman Poulsen:

jwp@wrapcrap:~$ cat test.f90 
program main
  implicit none
  integer :: max_nb
  type comm_mask
    integer(4), pointer :: mask(:)
  end type comm_mask
  type (comm_mask), allocatable, save :: encode(:,:)
  max_nb=2
  allocate( encode(1:1,1:max_nb))
  allocate( encode(1,1)%mask(1),encode(1,2)%mask(1))
end program main

jwp@wrapcrap:~$ gfortran test.f90 
test.f90:10.12-32:

  allocate( encode(1,1)%mask(1),encode(1,2)%mask(1))
            1                   2
Error: Allocate-object at (1) also appears at (2)


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

* [Bug fortran/55314] [4.6/4.7/4.8 Regression] Rejects some valid ALLOCATE statements
  2012-11-13 22:35 [Bug fortran/55314] New: [4.6/4.7/4.8 Regression] Rejects some valid ALLOCATE statements tkoenig at gcc dot gnu.org
@ 2012-11-13 22:39 ` tkoenig at gcc dot gnu.org
  2012-11-13 22:59 ` tkoenig at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2012-11-13 22:39 UTC (permalink / raw)
  To: gcc-bugs


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

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2012-11-13
         AssignedTo|unassigned at gcc dot       |tkoenig at gcc dot gnu.org
                   |gnu.org                     |
   Target Milestone|---                         |4.6.4
     Ever Confirmed|0                           |1


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

* [Bug fortran/55314] [4.6/4.7/4.8 Regression] Rejects some valid ALLOCATE statements
  2012-11-13 22:35 [Bug fortran/55314] New: [4.6/4.7/4.8 Regression] Rejects some valid ALLOCATE statements tkoenig at gcc dot gnu.org
  2012-11-13 22:39 ` [Bug fortran/55314] " tkoenig at gcc dot gnu.org
@ 2012-11-13 22:59 ` tkoenig at gcc dot gnu.org
  2012-11-20 12:29 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2012-11-13 22:59 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #1 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2012-11-13 22:59:22 UTC ---
Here's a tentative patch:

Index: resolve.c
===================================================================
--- resolve.c   (Revision 192894)
+++ resolve.c   (Arbeitskopie)
@@ -7618,12 +7618,18 @@ resolve_allocate_deallocate (gfc_code *code, const

                      if (pr->next && qr->next)
                        {
+                         int i;
                          gfc_array_ref *par = &(pr->u.ar);
                          gfc_array_ref *qar = &(qr->u.ar);
-                         if ((par->start[0] != NULL || qar->start[0] != NULL)
-                             && gfc_dep_compare_expr (par->start[0],
-                                                      qar->start[0]) != 0)
-                           break;
+
+                         for (i=0; i<par->dimen; i++)
+                           {
+                             if ((par->start[i] != NULL
+                                  || qar->start[i] != NULL)
+                                 && gfc_dep_compare_expr (par->start[i],
+                                                          qar->start[i]) != 0)
+                               goto break_label;
+                           }
                        }
                    }
                  else
@@ -7635,6 +7641,8 @@ resolve_allocate_deallocate (gfc_code *code, const
                  pr = pr->next;
                  qr = qr->next;
                }
+           break_label:
+             ;
            }
        }
     }


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

* [Bug fortran/55314] [4.6/4.7/4.8 Regression] Rejects some valid ALLOCATE statements
  2012-11-13 22:35 [Bug fortran/55314] New: [4.6/4.7/4.8 Regression] Rejects some valid ALLOCATE statements tkoenig at gcc dot gnu.org
  2012-11-13 22:39 ` [Bug fortran/55314] " tkoenig at gcc dot gnu.org
  2012-11-13 22:59 ` tkoenig at gcc dot gnu.org
@ 2012-11-20 12:29 ` jakub at gcc dot gnu.org
  2012-11-24 15:00 ` tkoenig at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-11-20 12:29 UTC (permalink / raw)
  To: gcc-bugs


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
                 CC|                            |jakub at gcc dot gnu.org


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

* [Bug fortran/55314] [4.6/4.7/4.8 Regression] Rejects some valid ALLOCATE statements
  2012-11-13 22:35 [Bug fortran/55314] New: [4.6/4.7/4.8 Regression] Rejects some valid ALLOCATE statements tkoenig at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-11-20 12:29 ` jakub at gcc dot gnu.org
@ 2012-11-24 15:00 ` tkoenig at gcc dot gnu.org
  2012-11-24 17:13 ` tkoenig at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2012-11-24 15:00 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2012-11-24 15:00:23 UTC ---
Author: tkoenig
Date: Sat Nov 24 15:00:16 2012
New Revision: 193778

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193778
Log:
2012-11-24  Thomas Koenig  <tkoenig@gcc.gnu.org>

    PR fortran/55314
    * resolve.c (resolve_allocate_deallocate):  Compare all
    subscripts when deciding if to reject a (de)allocate
    statement.

2012-11-24  Thomas Koenig  <tkoenig@gcc.gnu.org>

    PR fortran/55314
    * gfortran.dg/allocate_error_4.f90:  New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/allocate_error_4.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/resolve.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug fortran/55314] [4.6/4.7/4.8 Regression] Rejects some valid ALLOCATE statements
  2012-11-13 22:35 [Bug fortran/55314] New: [4.6/4.7/4.8 Regression] Rejects some valid ALLOCATE statements tkoenig at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2012-11-24 15:00 ` tkoenig at gcc dot gnu.org
@ 2012-11-24 17:13 ` tkoenig at gcc dot gnu.org
  2012-11-24 22:17 ` tkoenig at gcc dot gnu.org
  2012-11-24 22:20 ` tkoenig at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2012-11-24 17:13 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2012-11-24 17:13:31 UTC ---
Author: tkoenig
Date: Sat Nov 24 17:13:25 2012
New Revision: 193780

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193780
Log:
2012-11-24  Thomas Koenig  <tkoenig@gcc.gnu.org>

    PR fortran/55314
    Backport from trunk
    * resolve.c (resolve_allocate_deallocate):  Compare all
    subscripts when deciding if to reject a (de)allocate
    statement.

2012-11-24  Thomas Koenig  <tkoenig@gcc.gnu.org>

    PR fortran/55314
    Backport from trunk
    * gfortran.dg/allocate_error_4.f90:  New test.


Added:
    branches/gcc-4_7-branch/gcc/testsuite/gfortran.dg/allocate_error_4.f90
Modified:
    branches/gcc-4_7-branch/gcc/fortran/ChangeLog
    branches/gcc-4_7-branch/gcc/fortran/resolve.c
    branches/gcc-4_7-branch/gcc/testsuite/ChangeLog


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

* [Bug fortran/55314] [4.6/4.7/4.8 Regression] Rejects some valid ALLOCATE statements
  2012-11-13 22:35 [Bug fortran/55314] New: [4.6/4.7/4.8 Regression] Rejects some valid ALLOCATE statements tkoenig at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2012-11-24 17:13 ` tkoenig at gcc dot gnu.org
@ 2012-11-24 22:17 ` tkoenig at gcc dot gnu.org
  2012-11-24 22:20 ` tkoenig at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2012-11-24 22:17 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2012-11-24 22:17:40 UTC ---
Author: tkoenig
Date: Sat Nov 24 22:17:35 2012
New Revision: 193784

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193784
Log:
2012-11-24  Thomas Koenig  <tkoenig@gcc.gnu.org>

    PR fortran/55314
    Backport from trunk
    * resolve.c (resolve_allocate_deallocate):  Compare all
    subscripts when deciding if to reject a (de)allocate
    statement.

2012-11-24  Thomas Koenig  <tkoenig@gcc.gnu.org>

    PR fortran/55314
    Backport from trunk
    * gfortran.dg/allocate_error_4.f90:  New test.


Added:
    branches/gcc-4_6-branch/gcc/testsuite/gfortran.dg/allocate_error_4.f90
Modified:
    branches/gcc-4_6-branch/gcc/fortran/ChangeLog
    branches/gcc-4_6-branch/gcc/fortran/resolve.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


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

* [Bug fortran/55314] [4.6/4.7/4.8 Regression] Rejects some valid ALLOCATE statements
  2012-11-13 22:35 [Bug fortran/55314] New: [4.6/4.7/4.8 Regression] Rejects some valid ALLOCATE statements tkoenig at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2012-11-24 22:17 ` tkoenig at gcc dot gnu.org
@ 2012-11-24 22:20 ` tkoenig at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2012-11-24 22:20 UTC (permalink / raw)
  To: gcc-bugs


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

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

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

--- Comment #5 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2012-11-24 22:20:23 UTC ---
Fixed on all affected branches, closing.


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

end of thread, other threads:[~2012-11-24 22:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-13 22:35 [Bug fortran/55314] New: [4.6/4.7/4.8 Regression] Rejects some valid ALLOCATE statements tkoenig at gcc dot gnu.org
2012-11-13 22:39 ` [Bug fortran/55314] " tkoenig at gcc dot gnu.org
2012-11-13 22:59 ` tkoenig at gcc dot gnu.org
2012-11-20 12:29 ` jakub at gcc dot gnu.org
2012-11-24 15:00 ` tkoenig at gcc dot gnu.org
2012-11-24 17:13 ` tkoenig at gcc dot gnu.org
2012-11-24 22:17 ` tkoenig at gcc dot gnu.org
2012-11-24 22:20 ` tkoenig 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).