public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/103418] New: random_number() does not accept pointer, intent(in) array argument
@ 2021-11-24 20:59 baradi09 at gmail dot com
  2021-11-24 21:41 ` [Bug fortran/103418] " anlauf at gcc dot gnu.org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: baradi09 at gmail dot com @ 2021-11-24 20:59 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103418

            Bug ID: 103418
           Summary: random_number() does not accept pointer, intent(in)
                    array argument
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: baradi09 at gmail dot com
  Target Milestone: ---

The following module is, at least according to the discussion on
fortran-lang.discourse
(https://fortran-lang.discourse.group/t/meaning-of-the-intent-for-pointer-dummy-arguments/2328/11)
is standard complying, but gfortran stops with an error message when compiling
it. Someone in that topic also posted a gcc-patch, which may fix the issue.

Code:

module m
contains
   subroutine s1(a)
      real, pointer, intent(in) :: a
      call s2(a )           !<-- Ok with gfortran
      call random_number(a) !<-- but not this
   end subroutine
   subroutine s2(x)
      real, intent(out) :: x
      call random_number(x)
   end subroutine
end module

Error message:

bug3.f90:6:25:

    6 |       call random_number(a) !<-- but not this
      |                         1
Error: ‘harvest’ argument of ‘random_number’ intrinsic at (1) cannot be
INTENT(IN)

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

* [Bug fortran/103418] random_number() does not accept pointer, intent(in) array argument
  2021-11-24 20:59 [Bug fortran/103418] New: random_number() does not accept pointer, intent(in) array argument baradi09 at gmail dot com
@ 2021-11-24 21:41 ` anlauf at gcc dot gnu.org
  2021-11-24 22:10 ` anlauf at gcc dot gnu.org
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-11-24 21:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103418

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-11-24

--- Comment #1 from anlauf at gcc dot gnu.org ---
Confirmed.

As a side note: Intel does not like it, either.  But NAG and Nvidia do.

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

* [Bug fortran/103418] random_number() does not accept pointer, intent(in) array argument
  2021-11-24 20:59 [Bug fortran/103418] New: random_number() does not accept pointer, intent(in) array argument baradi09 at gmail dot com
  2021-11-24 21:41 ` [Bug fortran/103418] " anlauf at gcc dot gnu.org
@ 2021-11-24 22:10 ` anlauf at gcc dot gnu.org
  2021-11-24 23:27 ` kargl at gcc dot gnu.org
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-11-24 22:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103418

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anlauf at gcc dot gnu.org

--- Comment #2 from anlauf at gcc dot gnu.org ---
The nearly obvious fix:

diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 837eb0912c0..3859e18c6c3 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -1031,7 +1031,7 @@ variable_check (gfc_expr *e, int n, bool allow_proc)
            break;
        }

-      if (!ref)
+      if (!ref && !pointer)
        {
          gfc_error ("%qs argument of %qs intrinsic at %L cannot be "
                     "INTENT(IN)", gfc_current_intrinsic_arg[n]->name,

regresses for gfortran.dg/move_alloc_8.f90, thus needs additional
investigation.

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

* [Bug fortran/103418] random_number() does not accept pointer, intent(in) array argument
  2021-11-24 20:59 [Bug fortran/103418] New: random_number() does not accept pointer, intent(in) array argument baradi09 at gmail dot com
  2021-11-24 21:41 ` [Bug fortran/103418] " anlauf at gcc dot gnu.org
  2021-11-24 22:10 ` anlauf at gcc dot gnu.org
@ 2021-11-24 23:27 ` kargl at gcc dot gnu.org
  2021-11-25 21:02 ` anlauf at gcc dot gnu.org
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: kargl at gcc dot gnu.org @ 2021-11-24 23:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103418

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #3 from kargl at gcc dot gnu.org ---
(In reply to anlauf from comment #2)
> The nearly obvious fix:
> 
> diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
> index 837eb0912c0..3859e18c6c3 100644
> --- a/gcc/fortran/check.c
> +++ b/gcc/fortran/check.c
> @@ -1031,7 +1031,7 @@ variable_check (gfc_expr *e, int n, bool allow_proc)
>             break;
>         }
>  
> -      if (!ref)
> +      if (!ref && !pointer)
>         {
>           gfc_error ("%qs argument of %qs intrinsic at %L cannot be "
>                      "INTENT(IN)", gfc_current_intrinsic_arg[n]->name,
> 
> regresses for gfortran.dg/move_alloc_8.f90, thus needs additional
> investigation.

Did you try the patch posted in Fortran Discourse?

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

* [Bug fortran/103418] random_number() does not accept pointer, intent(in) array argument
  2021-11-24 20:59 [Bug fortran/103418] New: random_number() does not accept pointer, intent(in) array argument baradi09 at gmail dot com
                   ` (2 preceding siblings ...)
  2021-11-24 23:27 ` kargl at gcc dot gnu.org
@ 2021-11-25 21:02 ` anlauf at gcc dot gnu.org
  2021-11-25 21:07 ` sgk at troutmask dot apl.washington.edu
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-11-25 21:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103418

--- Comment #4 from anlauf at gcc dot gnu.org ---
(In reply to kargl from comment #3)
> (In reply to anlauf from comment #2)
> > The nearly obvious fix:
> > 
> > diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
> > index 837eb0912c0..3859e18c6c3 100644
> > --- a/gcc/fortran/check.c
> > +++ b/gcc/fortran/check.c
> > @@ -1031,7 +1031,7 @@ variable_check (gfc_expr *e, int n, bool allow_proc)
> >             break;
> >         }
> >  
> > -      if (!ref)
> > +      if (!ref && !pointer)
> >         {
> >           gfc_error ("%qs argument of %qs intrinsic at %L cannot be "
> >                      "INTENT(IN)", gfc_current_intrinsic_arg[n]->name,
> > 
> > regresses for gfortran.dg/move_alloc_8.f90, thus needs additional
> > investigation.
> 
> Did you try the patch posted in Fortran Discourse?

No.

I'm afraid I also missed it on the usual channels where patches for gcc
are posted.

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

* [Bug fortran/103418] random_number() does not accept pointer, intent(in) array argument
  2021-11-24 20:59 [Bug fortran/103418] New: random_number() does not accept pointer, intent(in) array argument baradi09 at gmail dot com
                   ` (3 preceding siblings ...)
  2021-11-25 21:02 ` anlauf at gcc dot gnu.org
@ 2021-11-25 21:07 ` sgk at troutmask dot apl.washington.edu
  2021-11-25 22:10 ` anlauf at gcc dot gnu.org
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: sgk at troutmask dot apl.washington.edu @ 2021-11-25 21:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103418

--- Comment #5 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Thu, Nov 25, 2021 at 09:02:34PM +0000, anlauf at gcc dot gnu.org wrote:
> (In reply to kargl from comment #3)
> > (In reply to anlauf from comment #2)
> > > The nearly obvious fix:
> > > 
> > > diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
> > > index 837eb0912c0..3859e18c6c3 100644
> > > --- a/gcc/fortran/check.c
> > > +++ b/gcc/fortran/check.c
> > > @@ -1031,7 +1031,7 @@ variable_check (gfc_expr *e, int n, bool allow_proc)
> > >             break;
> > >         }
> > >  
> > > -      if (!ref)
> > > +      if (!ref && !pointer)
> > >         {
> > >           gfc_error ("%qs argument of %qs intrinsic at %L cannot be "
> > >                      "INTENT(IN)", gfc_current_intrinsic_arg[n]->name,
> > > 
> > > regresses for gfortran.dg/move_alloc_8.f90, thus needs additional
> > > investigation.
> > 
> > Did you try the patch posted in Fortran Discourse?
> 
> No.
> 
> I'm afraid I also missed it on the usual channels where patches for gcc
> are posted.
> 

As explained on FD, I don't report problems found be other 
people who post them in FD, stackoverflow, or c.l.f.  I
encourage those people to report the problems themselves.

That said, you found the right location to patch.  The
code looks convoluted to deal with CLASS, which messes
up an array with the pointer attribute.


diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 6ea6e136d4f..e96bcdb1b44 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -1031,7 +1031,7 @@ variable_check (gfc_expr *e, int n, bool allow_proc)
            break;
        }

-      if (!ref)
+      if (!ref && !(pointer && e->ref && e->ref->type == REF_ARRAY))
        {
          gfc_error ("%qs argument of %qs intrinsic at %L cannot be "
                     "INTENT(IN)", gfc_current_intrinsic_arg[n]->name,
@@ -1062,7 +1062,8 @@ variable_check (gfc_expr *e, int n, bool allow_proc)
     return true;

   gfc_error ("%qs argument of %qs intrinsic at %L must be a variable",
-            gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic,
&e->where);
+            gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic,
+            &e->where);

   return false;
 }

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

* [Bug fortran/103418] random_number() does not accept pointer, intent(in) array argument
  2021-11-24 20:59 [Bug fortran/103418] New: random_number() does not accept pointer, intent(in) array argument baradi09 at gmail dot com
                   ` (4 preceding siblings ...)
  2021-11-25 21:07 ` sgk at troutmask dot apl.washington.edu
@ 2021-11-25 22:10 ` anlauf at gcc dot gnu.org
  2021-11-25 22:18 ` sgk at troutmask dot apl.washington.edu
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-11-25 22:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103418

--- Comment #6 from anlauf at gcc dot gnu.org ---
Unfortunately the patch in comment#5 does not work for me. :-(

Interestingly, the Intel compiler fails on the testcase, too.

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

* [Bug fortran/103418] random_number() does not accept pointer, intent(in) array argument
  2021-11-24 20:59 [Bug fortran/103418] New: random_number() does not accept pointer, intent(in) array argument baradi09 at gmail dot com
                   ` (5 preceding siblings ...)
  2021-11-25 22:10 ` anlauf at gcc dot gnu.org
@ 2021-11-25 22:18 ` sgk at troutmask dot apl.washington.edu
  2021-11-25 23:19 ` sgk at troutmask dot apl.washington.edu
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: sgk at troutmask dot apl.washington.edu @ 2021-11-25 22:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103418

--- Comment #7 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Thu, Nov 25, 2021 at 10:10:32PM +0000, anlauf at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103418
> 
> --- Comment #6 from anlauf at gcc dot gnu.org ---
> Unfortunately the patch in comment#5 does not work for me. :-(
> 
> Interestingly, the Intel compiler fails on the testcase, too.
> 

Hmmm.  I did have a number of other patches in my tree.  I
wonder if one of those helped.  Unfortunately, I updated
my git repository, where I cleared out all patch, and it
takes a long time to rebuild gcc on my laptop.

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

* [Bug fortran/103418] random_number() does not accept pointer, intent(in) array argument
  2021-11-24 20:59 [Bug fortran/103418] New: random_number() does not accept pointer, intent(in) array argument baradi09 at gmail dot com
                   ` (6 preceding siblings ...)
  2021-11-25 22:18 ` sgk at troutmask dot apl.washington.edu
@ 2021-11-25 23:19 ` sgk at troutmask dot apl.washington.edu
  2021-11-26 19:27 ` sgk at troutmask dot apl.washington.edu
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: sgk at troutmask dot apl.washington.edu @ 2021-11-25 23:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103418

--- Comment #8 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Thu, Nov 25, 2021 at 02:18:46PM -0800, Steve Kargl wrote:
> On Thu, Nov 25, 2021 at 10:10:32PM +0000, anlauf at gcc dot gnu.org wrote:
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103418
> > 
> > --- Comment #6 from anlauf at gcc dot gnu.org ---
> > Unfortunately the patch in comment#5 does not work for me. :-(
> > 
> > Interestingly, the Intel compiler fails on the testcase, too.
> > 
> 
> Hmmm.  I did have a number of other patches in my tree.  I
> wonder if one of those helped.  Unfortunately, I updated
> my git repository, where I cleared out all patch, and it
> takes a long time to rebuild gcc on my laptop.
> 

For the record, 

module test
   implicit none
   contains
   subroutine change_pointer_target(ptr)
      real, pointer, intent(in) :: ptr(:)
      call random_number(ptr)
      ptr(:) = ptr + 1.0
   end subroutine change_pointer_target
end module test

program foo
   use test
   implicit none
   real, pointer :: a(:), b
   allocate(a(4), b)
   call random_number(b)
   call random_number(a)
   print '(5F8.5)', b, a
end program foo

% gfcx -o z a.f90 && ./z
 0.65287 0.82614 0.77541 0.61923 0.52961

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

* [Bug fortran/103418] random_number() does not accept pointer, intent(in) array argument
  2021-11-24 20:59 [Bug fortran/103418] New: random_number() does not accept pointer, intent(in) array argument baradi09 at gmail dot com
                   ` (7 preceding siblings ...)
  2021-11-25 23:19 ` sgk at troutmask dot apl.washington.edu
@ 2021-11-26 19:27 ` sgk at troutmask dot apl.washington.edu
  2021-11-26 20:13 ` anlauf at gcc dot gnu.org
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: sgk at troutmask dot apl.washington.edu @ 2021-11-26 19:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103418

--- Comment #9 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Thu, Nov 25, 2021 at 10:10:32PM +0000, anlauf at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103418
> 
> --- Comment #6 from anlauf at gcc dot gnu.org ---
> Unfortunately the patch in comment#5 does not work for me. :-(
> 
> Interestingly, the Intel compiler fails on the testcase, too.
> 

"does not work for me" isn't too descriptive.

I just bootstrap gcc on x86_64-*-freebsd from clean
source (i.e., no  patches at all).  There are failures
with reshape_shape_2.f90 and vector_subscript_1.f90.

If I apply my simply patch, 

% git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   gcc/fortran/check.c

no changes added to commit (use "git add" and/or "git commit -a")

% git diff gcc/fortran/check.c | cat
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 5a5aca10ebe..a0870fc87f1 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -1031,7 +1031,7 @@ variable_check (gfc_expr *e, int n, bool allow_proc)
            break;
        }

-      if (!ref)
+      if (!ref && !(pointer  && e->ref && e->ref->type == REF_ARRAY))
        {
          gfc_error ("%qs argument of %qs intrinsic at %L cannot be "
                     "INTENT(IN)", gfc_current_intrinsic_arg[n]->name,

then the code compiles and produces

% gfcx -o z a.f90
% ./z
 0.76536 0.09307 0.55571 0.28371 0.79951

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

* [Bug fortran/103418] random_number() does not accept pointer, intent(in) array argument
  2021-11-24 20:59 [Bug fortran/103418] New: random_number() does not accept pointer, intent(in) array argument baradi09 at gmail dot com
                   ` (8 preceding siblings ...)
  2021-11-26 19:27 ` sgk at troutmask dot apl.washington.edu
@ 2021-11-26 20:13 ` anlauf at gcc dot gnu.org
  2021-11-26 21:58 ` sgk at troutmask dot apl.washington.edu
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-11-26 20:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103418

--- Comment #10 from anlauf at gcc dot gnu.org ---
(In reply to Steve Kargl from comment #9)
> "does not work for me" isn't too descriptive.

Well, you fixed a related issue, but not the problem in comment#0.

Try your patch on:

module m
contains
  subroutine s1 (a, b)
    real, pointer, intent(in) :: a, b(:)
    call random_number (a)
    call random_number (b)
  end subroutine s1
end module

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

* [Bug fortran/103418] random_number() does not accept pointer, intent(in) array argument
  2021-11-24 20:59 [Bug fortran/103418] New: random_number() does not accept pointer, intent(in) array argument baradi09 at gmail dot com
                   ` (9 preceding siblings ...)
  2021-11-26 20:13 ` anlauf at gcc dot gnu.org
@ 2021-11-26 21:58 ` sgk at troutmask dot apl.washington.edu
  2021-12-05 21:55 ` anlauf at gcc dot gnu.org
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: sgk at troutmask dot apl.washington.edu @ 2021-11-26 21:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103418

--- Comment #11 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Fri, Nov 26, 2021 at 08:13:05PM +0000, anlauf at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103418
> 
> --- Comment #10 from anlauf at gcc dot gnu.org ---
> (In reply to Steve Kargl from comment #9)
> > "does not work for me" isn't too descriptive.
> 
> Well, you fixed a related issue, but not the problem in comment#0.
> 
> Try your patch on:
> 
> module m
> contains
>   subroutine s1 (a, b)
>     real, pointer, intent(in) :: a, b(:)
>     call random_number (a)
>     call random_number (b)
>   end subroutine s1
> end module
> 

That's at least sufficient to fix your issue.

diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 5a5aca10ebe..49bb9d350f0 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -1031,7 +1031,9 @@ variable_check (gfc_expr *e, int n, bool allow_proc)
            break;
        }

-      if (!ref)
+      if (!ref
+         && !(pointer
+               && ((e->ref && e->ref->type == REF_ARRAY) || e->rank == 0)))
        {
          gfc_error ("%qs argument of %qs intrinsic at %L cannot be "
                     "INTENT(IN)", gfc_current_intrinsic_arg[n]->name,
@@ -1062,7 +1064,8 @@ variable_check (gfc_expr *e, int n, bool allow_proc)
     return true;

   gfc_error ("%qs argument of %qs intrinsic at %L must be a variable",
-            gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic,
&e->where);
+            gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic,
+            &e->where);

   return false;
 }

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

* [Bug fortran/103418] random_number() does not accept pointer, intent(in) array argument
  2021-11-24 20:59 [Bug fortran/103418] New: random_number() does not accept pointer, intent(in) array argument baradi09 at gmail dot com
                   ` (10 preceding siblings ...)
  2021-11-26 21:58 ` sgk at troutmask dot apl.washington.edu
@ 2021-12-05 21:55 ` anlauf at gcc dot gnu.org
  2021-12-10 18:07 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-12-05 21:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103418

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |anlauf at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #12 from anlauf at gcc dot gnu.org ---
Packaged: https://gcc.gnu.org/pipermail/fortran/2021-December/057125.html

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

* [Bug fortran/103418] random_number() does not accept pointer, intent(in) array argument
  2021-11-24 20:59 [Bug fortran/103418] New: random_number() does not accept pointer, intent(in) array argument baradi09 at gmail dot com
                   ` (11 preceding siblings ...)
  2021-12-05 21:55 ` anlauf at gcc dot gnu.org
@ 2021-12-10 18:07 ` cvs-commit at gcc dot gnu.org
  2021-12-19 21:20 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-12-10 18:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103418

--- Comment #13 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Harald Anlauf <anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:bb6a1ebb8585b85879735d0d6df9535885fad165

commit r12-5900-gbb6a1ebb8585b85879735d0d6df9535885fad165
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Thu Dec 9 22:57:13 2021 +0100

    Fortran: fix check for pointer dummy arguments with INTENT(IN)

    gcc/fortran/ChangeLog:

            PR fortran/103418
            * check.c (variable_check): Replace previous check of procedure
            dummy arguments with INTENT(IN) attribute when passed to intrinsic
            procedures by gfc_check_vardef_context.
            * expr.c (gfc_check_vardef_context): Correct check of INTENT(IN)
            dummy arguments for the case of sub-components of a CLASS pointer.

    gcc/testsuite/ChangeLog:

            PR fortran/103418
            * gfortran.dg/move_alloc_8.f90: Adjust error messages.
            * gfortran.dg/pointer_intent_9.f90: New test.

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

* [Bug fortran/103418] random_number() does not accept pointer, intent(in) array argument
  2021-11-24 20:59 [Bug fortran/103418] New: random_number() does not accept pointer, intent(in) array argument baradi09 at gmail dot com
                   ` (12 preceding siblings ...)
  2021-12-10 18:07 ` cvs-commit at gcc dot gnu.org
@ 2021-12-19 21:20 ` cvs-commit at gcc dot gnu.org
  2021-12-27 20:33 ` cvs-commit at gcc dot gnu.org
  2021-12-27 20:35 ` anlauf at gcc dot gnu.org
  15 siblings, 0 replies; 17+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-12-19 21:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103418

--- Comment #14 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:57b51b8bae4c2ecec3281929f57e4a6a0e6f9ea0

commit r11-9404-g57b51b8bae4c2ecec3281929f57e4a6a0e6f9ea0
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Thu Dec 9 22:57:13 2021 +0100

    Fortran: fix check for pointer dummy arguments with INTENT(IN)

    gcc/fortran/ChangeLog:

            PR fortran/103418
            * check.c (variable_check): Replace previous check of procedure
            dummy arguments with INTENT(IN) attribute when passed to intrinsic
            procedures by gfc_check_vardef_context.
            * expr.c (gfc_check_vardef_context): Correct check of INTENT(IN)
            dummy arguments for the case of sub-components of a CLASS pointer.

    gcc/testsuite/ChangeLog:

            PR fortran/103418
            * gfortran.dg/move_alloc_8.f90: Adjust error messages.
            * gfortran.dg/pointer_intent_9.f90: New test.

    (cherry picked from commit bb6a1ebb8585b85879735d0d6df9535885fad165)

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

* [Bug fortran/103418] random_number() does not accept pointer, intent(in) array argument
  2021-11-24 20:59 [Bug fortran/103418] New: random_number() does not accept pointer, intent(in) array argument baradi09 at gmail dot com
                   ` (13 preceding siblings ...)
  2021-12-19 21:20 ` cvs-commit at gcc dot gnu.org
@ 2021-12-27 20:33 ` cvs-commit at gcc dot gnu.org
  2021-12-27 20:35 ` anlauf at gcc dot gnu.org
  15 siblings, 0 replies; 17+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-12-27 20:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103418

--- Comment #15 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:f8486c9fd71c08f30273e1a98b86e35a679ca229

commit r10-10364-gf8486c9fd71c08f30273e1a98b86e35a679ca229
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Thu Dec 9 22:57:13 2021 +0100

    Fortran: fix check for pointer dummy arguments with INTENT(IN)

    gcc/fortran/ChangeLog:

            PR fortran/103418
            * check.c (variable_check): Replace previous check of procedure
            dummy arguments with INTENT(IN) attribute when passed to intrinsic
            procedures by gfc_check_vardef_context.
            * expr.c (gfc_check_vardef_context): Correct check of INTENT(IN)
            dummy arguments for the case of sub-components of a CLASS pointer.

    gcc/testsuite/ChangeLog:

            PR fortran/103418
            * gfortran.dg/move_alloc_8.f90: Adjust error messages.
            * gfortran.dg/pointer_intent_9.f90: New test.

    (cherry picked from commit bb6a1ebb8585b85879735d0d6df9535885fad165)

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

* [Bug fortran/103418] random_number() does not accept pointer, intent(in) array argument
  2021-11-24 20:59 [Bug fortran/103418] New: random_number() does not accept pointer, intent(in) array argument baradi09 at gmail dot com
                   ` (14 preceding siblings ...)
  2021-12-27 20:33 ` cvs-commit at gcc dot gnu.org
@ 2021-12-27 20:35 ` anlauf at gcc dot gnu.org
  15 siblings, 0 replies; 17+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-12-27 20:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103418

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED
           Priority|P3                          |P4
   Target Milestone|---                         |10.4

--- Comment #16 from anlauf at gcc dot gnu.org ---
Fixed on mainline for gcc-12, and on 11- and 10-branch.  Closing.

Thanks for the report!

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

end of thread, other threads:[~2021-12-27 20:35 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-24 20:59 [Bug fortran/103418] New: random_number() does not accept pointer, intent(in) array argument baradi09 at gmail dot com
2021-11-24 21:41 ` [Bug fortran/103418] " anlauf at gcc dot gnu.org
2021-11-24 22:10 ` anlauf at gcc dot gnu.org
2021-11-24 23:27 ` kargl at gcc dot gnu.org
2021-11-25 21:02 ` anlauf at gcc dot gnu.org
2021-11-25 21:07 ` sgk at troutmask dot apl.washington.edu
2021-11-25 22:10 ` anlauf at gcc dot gnu.org
2021-11-25 22:18 ` sgk at troutmask dot apl.washington.edu
2021-11-25 23:19 ` sgk at troutmask dot apl.washington.edu
2021-11-26 19:27 ` sgk at troutmask dot apl.washington.edu
2021-11-26 20:13 ` anlauf at gcc dot gnu.org
2021-11-26 21:58 ` sgk at troutmask dot apl.washington.edu
2021-12-05 21:55 ` anlauf at gcc dot gnu.org
2021-12-10 18:07 ` cvs-commit at gcc dot gnu.org
2021-12-19 21:20 ` cvs-commit at gcc dot gnu.org
2021-12-27 20:33 ` cvs-commit at gcc dot gnu.org
2021-12-27 20:35 ` anlauf 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).