public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/103608] New: ICE in do_intent, at fortran/frontend-passes.c:3035
@ 2021-12-07 19:42 gscfq@t-online.de
  2022-05-24 18:41 ` [Bug fortran/103608] " kargl at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: gscfq@t-online.de @ 2021-12-07 19:42 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103608
           Summary: ICE in do_intent, at fortran/frontend-passes.c:3035
           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
   integer :: i, x
   x(*) = 0
   do i = 1, 2
      call s(x(i))
   end do
end


$ cat z2.f90
program p
   integer :: i, x
   x(*) = 0
   do i = 1, 2
      print *, x(i)
   end do
end


$ cat z3.f90
program p
   integer :: i, x
   x(*) = 0
   print *, (x(i), i=1,2)
end


$ gfortran-12-20211205 -c z1.f90
z1.f90:2:18:

    2 |    integer :: i, x
      |                  1
Error: Alternate return specifier in function 'x' at (1) is not allowed
z1.f90:5:13:

    5 |       call s(x(i))
      |             1
Error: Missing alternate return specifier in subroutine call at (1)
f951: internal compiler error: Segmentation fault
0xf0b99f crash_signal
        ../../gcc/toplev.c:322
0x9564d5 do_intent
        ../../gcc/fortran/frontend-passes.c:3035
0x9564d5 do_function
        ../../gcc/fortran/frontend-passes.c:2699
0x952495 gfc_expr_walker(gfc_expr**, int (*)(gfc_expr**, int*, void*), void*)
        ../../gcc/fortran/frontend-passes.c:5223
0x9554f3 gfc_code_walker(gfc_code**, int (*)(gfc_code**, int*, void*), int
(*)(gfc_expr**, int*, void*), void*)
        ../../gcc/fortran/frontend-passes.c:5392
0x954697 gfc_code_walker(gfc_code**, int (*)(gfc_code**, int*, void*), int
(*)(gfc_expr**, int*, void*), void*)
        ../../gcc/fortran/frontend-passes.c:5669
0x95570b doloop_warn
        ../../gcc/fortran/frontend-passes.c:3059
0x955c5a gfc_run_passes(gfc_namespace*)
        ../../gcc/fortran/frontend-passes.c:156
0x856467 gfc_resolve(gfc_namespace*)
        ../../gcc/fortran/resolve.c:17572
0x83e764 resolve_all_program_units
        ../../gcc/fortran/parse.c:6586
0x83e764 gfc_parse_file()
        ../../gcc/fortran/parse.c:6842
0x88c73f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:216

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

* [Bug fortran/103608] ICE in do_intent, at fortran/frontend-passes.c:3035
  2021-12-07 19:42 [Bug fortran/103608] New: ICE in do_intent, at fortran/frontend-passes.c:3035 gscfq@t-online.de
@ 2022-05-24 18:41 ` kargl at gcc dot gnu.org
  2023-02-15 20:19 ` 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-05-24 18:41 UTC (permalink / raw)
  To: gcc-bugs

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

kargl at gcc dot gnu.org changed:

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

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

diff --git a/gcc/fortran/frontend-passes.cc b/gcc/fortran/frontend-passes.cc
index 612c12d233d..f3549db5f98 100644
--- a/gcc/fortran/frontend-passes.cc
+++ b/gcc/fortran/frontend-passes.cc
@@ -3038,7 +3038,8 @@ do_intent (gfc_expr **e)
          do_sym = dl->ext.iterator->var->symtree->n.sym;

          if (a->expr && a->expr->symtree
-             && a->expr->symtree->n.sym == do_sym)
+             && a->expr->symtree->n.sym == do_sym
+             && f->sym)
            {
              if (f->sym->attr.intent == INTENT_OUT)
                gfc_error_now ("Variable %qs at %L set to undefined value "

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

* [Bug fortran/103608] ICE in do_intent, at fortran/frontend-passes.c:3035
  2021-12-07 19:42 [Bug fortran/103608] New: ICE in do_intent, at fortran/frontend-passes.c:3035 gscfq@t-online.de
  2022-05-24 18:41 ` [Bug fortran/103608] " kargl at gcc dot gnu.org
@ 2023-02-15 20:19 ` anlauf at gcc dot gnu.org
  2023-02-15 21:46 ` cvs-commit at gcc dot gnu.org
  2023-02-15 21:50 ` anlauf at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: anlauf at gcc dot gnu.org @ 2023-02-15 20:19 UTC (permalink / raw)
  To: gcc-bugs

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

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 ---
Pretty obvious.  Will take care of it.

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

* [Bug fortran/103608] ICE in do_intent, at fortran/frontend-passes.c:3035
  2021-12-07 19:42 [Bug fortran/103608] New: ICE in do_intent, at fortran/frontend-passes.c:3035 gscfq@t-online.de
  2022-05-24 18:41 ` [Bug fortran/103608] " kargl at gcc dot gnu.org
  2023-02-15 20:19 ` anlauf at gcc dot gnu.org
@ 2023-02-15 21:46 ` cvs-commit at gcc dot gnu.org
  2023-02-15 21:50 ` anlauf at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-02-15 21:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:c75cbeba81e5b4737a9ab7dd28cce650965535a9

commit r13-6067-gc75cbeba81e5b4737a9ab7dd28cce650965535a9
Author: Steve Kargl <kargl@gcc.gnu.org>
Date:   Wed Feb 15 22:40:37 2023 +0100

    Fortran: error recovery on checking procedure argument intent [PR103608]

    gcc/fortran/ChangeLog:

            PR fortran/103608
            * frontend-passes.cc (do_intent): Catch NULL pointer dereference on
            reference to invalid formal argument.

    gcc/testsuite/ChangeLog:

            PR fortran/103608
            * gfortran.dg/pr103608.f90: New test.

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

* [Bug fortran/103608] ICE in do_intent, at fortran/frontend-passes.c:3035
  2021-12-07 19:42 [Bug fortran/103608] New: ICE in do_intent, at fortran/frontend-passes.c:3035 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2023-02-15 21:46 ` cvs-commit at gcc dot gnu.org
@ 2023-02-15 21:50 ` anlauf at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: anlauf at gcc dot gnu.org @ 2023-02-15 21:50 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |13.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:[~2023-02-15 21:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-07 19:42 [Bug fortran/103608] New: ICE in do_intent, at fortran/frontend-passes.c:3035 gscfq@t-online.de
2022-05-24 18:41 ` [Bug fortran/103608] " kargl at gcc dot gnu.org
2023-02-15 20:19 ` anlauf at gcc dot gnu.org
2023-02-15 21:46 ` cvs-commit at gcc dot gnu.org
2023-02-15 21:50 ` 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).