public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/104571] New: ICE in resolve_elemental_actual, at fortran/resolve.cc:2383
@ 2022-02-16 17:33 gscfq@t-online.de
  2022-02-16 19:27 ` [Bug fortran/104571] " kargl at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: gscfq@t-online.de @ 2022-02-16 17:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104571
           Summary: ICE in resolve_elemental_actual, at
                    fortran/resolve.cc:2383
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Affects versions down to at least r5 :
(gcc configured with --enable-checking=yes)


$ cat z1.f90
program p
   real :: x(3)
   call g(x)
contains
   elemental subroutine g(*)
   end
end


$ gfortran-12-20220213 -c z1.f90
z1.f90:5:25:

    5 |    elemental subroutine g(*)
      |                         1
Error: Alternate return specifier in elemental subroutine 'g' at (1) is not
allowed
z1.f90:3:12:

    3 |    call g(x)
      |            1
Error: Missing alternate return specifier in subroutine call at (1)
f951: internal compiler error: Segmentation fault
0xe7073f crash_signal
        ../../gcc/toplev.cc:322
0x79bd73 resolve_elemental_actual
        ../../gcc/fortran/resolve.cc:2383
0x7ab0bb resolve_call
        ../../gcc/fortran/resolve.cc:3805
0x7a8449 gfc_resolve_code(gfc_code*, gfc_namespace*)
        ../../gcc/fortran/resolve.cc:12154
0x7aa977 resolve_codes
        ../../gcc/fortran/resolve.cc:17536
0x7aaa3e gfc_resolve(gfc_namespace*)
        ../../gcc/fortran/resolve.cc:17571
0x792d64 resolve_all_program_units
        ../../gcc/fortran/parse.cc:6586
0x792d64 gfc_parse_file()
        ../../gcc/fortran/parse.cc:6842
0x7e102f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.cc:216

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

* [Bug fortran/104571] ICE in resolve_elemental_actual, at fortran/resolve.cc:2383
  2022-02-16 17:33 [Bug fortran/104571] New: ICE in resolve_elemental_actual, at fortran/resolve.cc:2383 gscfq@t-online.de
@ 2022-02-16 19:27 ` kargl at gcc dot gnu.org
  2022-03-29 20:09 ` anlauf at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: kargl at gcc dot gnu.org @ 2022-02-16 19:27 UTC (permalink / raw)
  To: gcc-bugs

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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-02-16
             Status|UNCONFIRMED                 |NEW
                 CC|                            |kargl at gcc dot gnu.org
     Ever confirmed|0                           |1
           Priority|P3                          |P4

--- Comment #1 from kargl at gcc dot gnu.org ---
NULL pointer dereference.

diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc
index 835a4783718..83c895b079e 100644
--- a/gcc/fortran/resolve.cc
+++ b/gcc/fortran/resolve.cc
@@ -2380,8 +2382,9 @@ resolve_elemental_actual (gfc_expr *expr, gfc_code *c)
   if (rank > 0 && esym && expr == NULL)
     for (eformal = esym->formal, arg = arg0; arg && eformal;
         arg = arg->next, eformal = eformal->next)
-      if ((eformal->sym->attr.intent == INTENT_OUT
-          || eformal->sym->attr.intent == INTENT_INOUT)
+      if (eformal->sym
+         && (eformal->sym->attr.intent == INTENT_OUT
+             || eformal->sym->attr.intent == INTENT_INOUT)
          && arg->expr && arg->expr->rank == 0)
        {
          gfc_error ("Actual argument at %L for INTENT(%s) dummy %qs of "

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

* [Bug fortran/104571] ICE in resolve_elemental_actual, at fortran/resolve.cc:2383
  2022-02-16 17:33 [Bug fortran/104571] New: ICE in resolve_elemental_actual, at fortran/resolve.cc:2383 gscfq@t-online.de
  2022-02-16 19:27 ` [Bug fortran/104571] " kargl at gcc dot gnu.org
@ 2022-03-29 20:09 ` anlauf at gcc dot gnu.org
  2022-03-29 20:12 ` cvs-commit at gcc dot gnu.org
  2022-03-29 20:19 ` anlauf at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: anlauf at gcc dot gnu.org @ 2022-03-29 20:09 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

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

--- Comment #2 from anlauf at gcc dot gnu.org ---
(In reply to kargl from comment #1)
> NULL pointer dereference.
> 
> diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc

I'll handle this.

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

* [Bug fortran/104571] ICE in resolve_elemental_actual, at fortran/resolve.cc:2383
  2022-02-16 17:33 [Bug fortran/104571] New: ICE in resolve_elemental_actual, at fortran/resolve.cc:2383 gscfq@t-online.de
  2022-02-16 19:27 ` [Bug fortran/104571] " kargl at gcc dot gnu.org
  2022-03-29 20:09 ` anlauf at gcc dot gnu.org
@ 2022-03-29 20:12 ` cvs-commit at gcc dot gnu.org
  2022-03-29 20:19 ` anlauf at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-03-29 20:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 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:69db6e7f4e1d07bf8f33e93a29139cc16c1e0a2f

commit r12-7904-g69db6e7f4e1d07bf8f33e93a29139cc16c1e0a2f
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Tue Mar 29 22:12:15 2022 +0200

    Fortran: avoid NULL pointer dereference checking elemental procedure args

    gcc/fortran/ChangeLog:

            PR fortran/104571
            * resolve.cc (resolve_elemental_actual): Avoid NULL pointer
            dereference.

    gcc/testsuite/ChangeLog:

            PR fortran/104571
            * gfortran.dg/pr104571.f90: New test.

    Co-authored-by: Steven G. Kargl <kargl@gcc.gnu.org>

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

* [Bug fortran/104571] ICE in resolve_elemental_actual, at fortran/resolve.cc:2383
  2022-02-16 17:33 [Bug fortran/104571] New: ICE in resolve_elemental_actual, at fortran/resolve.cc:2383 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2022-03-29 20:12 ` cvs-commit at gcc dot gnu.org
@ 2022-03-29 20:19 ` anlauf at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: anlauf at gcc dot gnu.org @ 2022-03-29 20:19 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED
   Target Milestone|---                         |12.0

--- Comment #4 from anlauf at gcc dot gnu.org ---
Fixed.

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

end of thread, other threads:[~2022-03-29 20:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-16 17:33 [Bug fortran/104571] New: ICE in resolve_elemental_actual, at fortran/resolve.cc:2383 gscfq@t-online.de
2022-02-16 19:27 ` [Bug fortran/104571] " kargl at gcc dot gnu.org
2022-03-29 20:09 ` anlauf at gcc dot gnu.org
2022-03-29 20:12 ` cvs-commit at gcc dot gnu.org
2022-03-29 20:19 ` 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).