public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/36233]  New: [Regression 4.4,4.3] Array valued actual procedure argument rejected
@ 2008-05-13 20:40 pault at gcc dot gnu dot org
  2008-05-13 21:35 ` [Bug fortran/36233] " pault at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: pault at gcc dot gnu dot org @ 2008-05-13 20:40 UTC (permalink / raw)
  To: gcc-bugs

module mod
contains
  function foo (arg)
    integer foo (10)
    integer arg
    foo = arg
  end function
end module

  use mod
  call bar (foo)
contains
  subroutine bar (arg)
    interface
      function arg (x)
        integer arg (10)
        integer x
      end function
    end interface
    print *, arg (10)
  end subroutine
end

produces

test.f90:11.12:

  call bar (foo)
           1
Warning: Actual argument contains too few elements for dummy argument 'arg'
(1/10) at (1)


-- 
           Summary: [Regression 4.4,4.3] Array valued actual procedure
                    argument rejected
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pault at gcc dot gnu dot org


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


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

* [Bug fortran/36233] [Regression 4.4,4.3] Array valued actual procedure argument rejected
  2008-05-13 20:40 [Bug fortran/36233] New: [Regression 4.4,4.3] Array valued actual procedure argument rejected pault at gcc dot gnu dot org
@ 2008-05-13 21:35 ` pault at gcc dot gnu dot org
  2008-05-14  0:04 ` jvdelisle at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu dot org @ 2008-05-13 21:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pault at gcc dot gnu dot org  2008-05-13 21:34 -------
(In reply to comment #0)
This fixs it and regtests OK

Index: gcc/fortran/interface.c
===================================================================
*** gcc/fortran/interface.c     (revision 134835)
--- gcc/fortran/interface.c     (working copy)
*************** compare_actual_formal (gfc_actual_arglis
*** 1942,1948 ****

        actual_size = get_expr_storage_size (a->expr);
        formal_size = get_sym_storage_size (f->sym);
!       if (actual_size != 0 && actual_size < formal_size)
        {
          if (a->expr->ts.type == BT_CHARACTER && !f->sym->as && where)
            gfc_warning ("Character length of actual argument shorter "
--- 1942,1950 ----

        actual_size = get_expr_storage_size (a->expr);
        formal_size = get_sym_storage_size (f->sym);
!       if (actual_size != 0
!           && actual_size < formal_size
!           && a->expr->ts.type != BT_PROCEDURE)
        {
          if (a->expr->ts.type == BT_CHARACTER && !f->sym->as && where)
            gfc_warning ("Character length of actual argument shorter "


-- 


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


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

* [Bug fortran/36233] [Regression 4.4,4.3] Array valued actual procedure argument rejected
  2008-05-13 20:40 [Bug fortran/36233] New: [Regression 4.4,4.3] Array valued actual procedure argument rejected pault at gcc dot gnu dot org
  2008-05-13 21:35 ` [Bug fortran/36233] " pault at gcc dot gnu dot org
@ 2008-05-14  0:04 ` jvdelisle at gcc dot gnu dot org
  2008-05-14  5:16 ` pault at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-05-14  0:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jvdelisle at gcc dot gnu dot org  2008-05-14 00:04 -------
OK to commit as simple.


-- 


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


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

* [Bug fortran/36233] [Regression 4.4,4.3] Array valued actual procedure argument rejected
  2008-05-13 20:40 [Bug fortran/36233] New: [Regression 4.4,4.3] Array valued actual procedure argument rejected pault at gcc dot gnu dot org
  2008-05-13 21:35 ` [Bug fortran/36233] " pault at gcc dot gnu dot org
  2008-05-14  0:04 ` jvdelisle at gcc dot gnu dot org
@ 2008-05-14  5:16 ` pault at gcc dot gnu dot org
  2008-05-14 20:45 ` pault at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu dot org @ 2008-05-14  5:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pault at gcc dot gnu dot org  2008-05-14 05:15 -------
(In reply to comment #2)
> OK to commit as simple.
> 

Jerry,

In the clear light of day, I think that I need to separate the character and
the array checks.  I'll check the standard and try other compilers - once I 'm
happy, I'll commit.

Thanks

Paul


-- 


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


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

* [Bug fortran/36233] [Regression 4.4,4.3] Array valued actual procedure argument rejected
  2008-05-13 20:40 [Bug fortran/36233] New: [Regression 4.4,4.3] Array valued actual procedure argument rejected pault at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-05-14  5:16 ` pault at gcc dot gnu dot org
@ 2008-05-14 20:45 ` pault at gcc dot gnu dot org
  2008-05-14 21:34 ` pault at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu dot org @ 2008-05-14 20:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pault at gcc dot gnu dot org  2008-05-14 20:44 -------
(In reply to comment #3)
> (In reply to comment #2)

> Jerry,
> 
> In the clear light of day, I think that I need to separate the character and
> the array checks.  I'll check the standard and try other compilers - once I 'm
> happy, I'll commit.
> 

It's OK as it is.  Full testcase regtesting now.

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pault at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-05-14 20:44:18
               date|                            |


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


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

* [Bug fortran/36233] [Regression 4.4,4.3] Array valued actual procedure argument rejected
  2008-05-13 20:40 [Bug fortran/36233] New: [Regression 4.4,4.3] Array valued actual procedure argument rejected pault at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-05-14 20:45 ` pault at gcc dot gnu dot org
@ 2008-05-14 21:34 ` pault at gcc dot gnu dot org
  2008-05-17  7:12 ` pault at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu dot org @ 2008-05-14 21:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pault at gcc dot gnu dot org  2008-05-14 21:33 -------
Subject: Bug 36233

Author: pault
Date: Wed May 14 21:32:53 2008
New Revision: 135307

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=135307
Log:
2008-05-14  Paul Thomas  <pault@gcc.gnu.org>

       PR fortran/36233
       * interface.c (compare_actual_formal): Do not check sizes if the
       actual is BT_PROCEDURE.

2008-05-14  Paul Thomas  <pault@gcc.gnu.org>

       PR fortran/36233
       * gfortran.dg/actual_procedure_1.f90: New test


Added:
    trunk/gcc/testsuite/gfortran.dg/actual_procedure_1.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/interface.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/36233] [Regression 4.4,4.3] Array valued actual procedure argument rejected
  2008-05-13 20:40 [Bug fortran/36233] New: [Regression 4.4,4.3] Array valued actual procedure argument rejected pault at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-05-14 21:34 ` pault at gcc dot gnu dot org
@ 2008-05-17  7:12 ` pault at gcc dot gnu dot org
  2008-05-17  8:21 ` pault at gcc dot gnu dot org
  2008-05-22 20:15 ` [Bug fortran/36233] [4.3/4.4 Regression] " pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu dot org @ 2008-05-17  7:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pault at gcc dot gnu dot org  2008-05-17 07:11 -------
Subject: Bug 36233

Author: pault
Date: Sat May 17 07:10:13 2008
New Revision: 135461

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=135461
Log:
2008-05-17  Paul Thomas  <pault@gcc.gnu.org>

        Backport from mainline:
        PR fortran/35756
        PR fortran/35759
        * trans-stmt.c (gfc_trans_where): Tighten up the dependency
        check for calling gfc_trans_where_3.

        PR fortran/35743
        * trans-stmt.c (gfc_trans_where_2): Set the mask size to zero
        if it is calculated to be negative.

        PR fortran/35745
        * trans-stmt.c (gfc_trans_where_3, gfc_trans_where_assign): Set
        ss->where for scalar right hand sides.
        * trans-array.c (gfc_add_loop_ss_code): If ss->where is set do
        not evaluate scalars outside the loop.  Clean up whitespace.
        * trans.h : Add a bitfield 'where' to gfc_ss.

       PR fortran/36233
       * interface.c (compare_actual_formal): Do not check sizes if the
       actual is BT_PROCEDURE.

2008-05-17  Paul Thomas  <pault@gcc.gnu.org>

        Backport from mainline:
        PR fortran/35756
        PR fortran/35759
        * gfortran.dg/where_1.f90: New test.

        PR fortran/35743
        PR fortran/35745
        * gfortran.dg/where_2.f90: New test.

       PR fortran/36233
       * gfortran.dg/actual_procedure_1.f90: New test

Added:
    branches/gcc-4_3-branch/gcc/testsuite/gfortran.dg/actual_procedure_1.f90
    branches/gcc-4_3-branch/gcc/testsuite/gfortran.dg/where_1.f90
    branches/gcc-4_3-branch/gcc/testsuite/gfortran.dg/where_2.f90
Modified:
    branches/gcc-4_3-branch/gcc/fortran/ChangeLog
    branches/gcc-4_3-branch/gcc/fortran/interface.c
    branches/gcc-4_3-branch/gcc/fortran/trans-array.c
    branches/gcc-4_3-branch/gcc/fortran/trans-stmt.c
    branches/gcc-4_3-branch/gcc/fortran/trans.h
    branches/gcc-4_3-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/36233] [Regression 4.4,4.3] Array valued actual procedure argument rejected
  2008-05-13 20:40 [Bug fortran/36233] New: [Regression 4.4,4.3] Array valued actual procedure argument rejected pault at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2008-05-17  7:12 ` pault at gcc dot gnu dot org
@ 2008-05-17  8:21 ` pault at gcc dot gnu dot org
  2008-05-22 20:15 ` [Bug fortran/36233] [4.3/4.4 Regression] " pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu dot org @ 2008-05-17  8:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pault at gcc dot gnu dot org  2008-05-17 08:20 -------
Fixed on trunk and 4.3.

Thanks for the report.

Paul


-- 

pault at gcc dot gnu dot org changed:

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


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


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

* [Bug fortran/36233] [4.3/4.4 Regression] Array valued actual procedure argument rejected
  2008-05-13 20:40 [Bug fortran/36233] New: [Regression 4.4,4.3] Array valued actual procedure argument rejected pault at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2008-05-17  8:21 ` pault at gcc dot gnu dot org
@ 2008-05-22 20:15 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-05-22 20:15 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[Regression 4.4,4.3] Array  |[4.3/4.4 Regression] Array
                   |valued actual procedure     |valued actual procedure
                   |argument rejected           |argument rejected
   Target Milestone|---                         |4.3.1


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


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

end of thread, other threads:[~2008-05-22 20:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-13 20:40 [Bug fortran/36233] New: [Regression 4.4,4.3] Array valued actual procedure argument rejected pault at gcc dot gnu dot org
2008-05-13 21:35 ` [Bug fortran/36233] " pault at gcc dot gnu dot org
2008-05-14  0:04 ` jvdelisle at gcc dot gnu dot org
2008-05-14  5:16 ` pault at gcc dot gnu dot org
2008-05-14 20:45 ` pault at gcc dot gnu dot org
2008-05-14 21:34 ` pault at gcc dot gnu dot org
2008-05-17  7:12 ` pault at gcc dot gnu dot org
2008-05-17  8:21 ` pault at gcc dot gnu dot org
2008-05-22 20:15 ` [Bug fortran/36233] [4.3/4.4 Regression] " pinskia 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).