public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/64925] New: ICE with same names for dummy arg and internal procedure
@ 2015-02-03 18:31 longb at cray dot com
  2015-02-03 20:10 ` [Bug fortran/64925] " kargl at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: longb at cray dot com @ 2015-02-03 18:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 64925
           Summary: ICE with same names for dummy arg and internal
                    procedure
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: longb at cray dot com

> cat test.f90
subroutine foo(nnn, aaa, bbb, ccc)
  implicit none
  integer :: nnn, aaa, bbb(nnn)
  integer :: i
  do i=1,nnn
     aaa = aaa + bbb(ccc(i))
  end do
contains
  integer function ccc(i)
    implicit none
    integer :: i
    ccc = i
  end function ccc
end subroutine foo
> gfortran -c test.f90
test.f90: In function 'foo':
test.f90:1:0: internal compiler error: Segmentation fault
 subroutine foo(nnn, aaa, bbb, ccc)
 ^
0x99c48f crash_signal
    ../../cray-gcc-4.9.2/gcc/toplev.c:337
0x687b03 create_function_arglist
    ../../cray-gcc-4.9.2/gcc/fortran/trans-decl.c:2142
0x68af6b gfc_create_function_decl(gfc_namespace*, bool)
    ../../cray-gcc-4.9.2/gcc/fortran/trans-decl.c:2585
0x68f689 gfc_generate_contained_functions
    ../../cray-gcc-4.9.2/gcc/fortran/trans-decl.c:4762
0x68f689 gfc_generate_function_code(gfc_namespace*)
    ../../cray-gcc-4.9.2/gcc/fortran/trans-decl.c:5589
0x62efe0 translate_all_program_units
    ../../cray-gcc-4.9.2/gcc/fortran/parse.c:4953
0x62efe0 gfc_parse_file()
    ../../cray-gcc-4.9.2/gcc/fortran/parse.c:5150
0x66c105 gfc_be_parse_file
    ../../cray-gcc-4.9.2/gcc/fortran/f95-lang.c:212
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


Expected: Error message saying that a dummy argument and an internal procedure
cannot have the same name in a scoping unit. (Both are class 1 local
identifiers in subclause 16.3.1.)


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

* [Bug fortran/64925] ICE with same names for dummy arg and internal procedure
  2015-02-03 18:31 [Bug fortran/64925] New: ICE with same names for dummy arg and internal procedure longb at cray dot com
@ 2015-02-03 20:10 ` kargl at gcc dot gnu.org
  2015-02-03 20:47 ` longb at cray dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: kargl at gcc dot gnu.org @ 2015-02-03 20:10 UTC (permalink / raw)
  To: gcc-bugs

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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-02-03
                 CC|                            |kargl at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from kargl at gcc dot gnu.org ---
Here's patch.  Not sure if it is completely correct.

Index: symbol.c
===================================================================
--- symbol.c    (revision 220347)
+++ symbol.c    (working copy)
@@ -458,6 +458,11 @@ check_conflict (symbol_attribute *attr, 
     }
     }

+  if (attr->dummy && ((attr->function || attr->subroutine) && 
+            gfc_current_state () == COMP_CONTAINS))
+    gfc_error_now ("internal procedure '%s' at %L conflicts with "
+           "DUMMY argument", name, where);
+
   conf (dummy, entry);
   conf (dummy, intrinsic);
   conf (dummy, threadprivate);

% gfc5x -c bl.f90
bl.f90:9:25:

   integer function ccc(i)
                         1
Error: internal procedure 'ccc' at (1) conflicts with DUMMY argument


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

* [Bug fortran/64925] ICE with same names for dummy arg and internal procedure
  2015-02-03 18:31 [Bug fortran/64925] New: ICE with same names for dummy arg and internal procedure longb at cray dot com
  2015-02-03 20:10 ` [Bug fortran/64925] " kargl at gcc dot gnu.org
@ 2015-02-03 20:47 ` longb at cray dot com
  2015-05-18 19:26 ` kargl at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: longb at cray dot com @ 2015-02-03 20:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Bill Long <longb at cray dot com> ---
The error message in Comment 1 provides correct information, and the
compilation does not cause an ICE, so this is a definite improvement.


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

* [Bug fortran/64925] ICE with same names for dummy arg and internal procedure
  2015-02-03 18:31 [Bug fortran/64925] New: ICE with same names for dummy arg and internal procedure longb at cray dot com
  2015-02-03 20:10 ` [Bug fortran/64925] " kargl at gcc dot gnu.org
  2015-02-03 20:47 ` longb at cray dot com
@ 2015-05-18 19:26 ` kargl at gcc dot gnu.org
  2015-05-19 17:02 ` kargl at gcc dot gnu.org
  2015-05-19 17:02 ` kargl at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: kargl at gcc dot gnu.org @ 2015-05-18 19:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Mon May 18 19:25:49 2015
New Revision: 223313

URL: https://gcc.gnu.org/viewcvs?rev=223313&root=gcc&view=rev
Log:
2015-05-18  Steven G. Kargl  <kargl@gcc.gnu.org>

        PR fortran/64925
        * symbol.c(check_conflict):  Check for a conflict between a dummy
        argument and an internal procedure name.

2015-05-18  Steven G. Kargl  <kargl@gcc.gnu.org>

        PR fortran/64925
        * gfortran.dg/pr64925.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/pr64925.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/symbol.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug fortran/64925] ICE with same names for dummy arg and internal procedure
  2015-02-03 18:31 [Bug fortran/64925] New: ICE with same names for dummy arg and internal procedure longb at cray dot com
                   ` (3 preceding siblings ...)
  2015-05-19 17:02 ` kargl at gcc dot gnu.org
@ 2015-05-19 17:02 ` kargl at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: kargl at gcc dot gnu.org @ 2015-05-19 17:02 UTC (permalink / raw)
  To: gcc-bugs

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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |5.2

--- Comment #5 from kargl at gcc dot gnu.org ---
Fixed on trunk and 5-branch.  Thaks for the bug report.


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

* [Bug fortran/64925] ICE with same names for dummy arg and internal procedure
  2015-02-03 18:31 [Bug fortran/64925] New: ICE with same names for dummy arg and internal procedure longb at cray dot com
                   ` (2 preceding siblings ...)
  2015-05-18 19:26 ` kargl at gcc dot gnu.org
@ 2015-05-19 17:02 ` kargl at gcc dot gnu.org
  2015-05-19 17:02 ` kargl at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: kargl at gcc dot gnu.org @ 2015-05-19 17:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Tue May 19 17:01:25 2015
New Revision: 223388

URL: https://gcc.gnu.org/viewcvs?rev=223388&root=gcc&view=rev
Log:
2015-05-19  Steven G. Kargl  <kargl@gcc.gnu.org>

        PR fortran/64925
        * symbol.c(check_conflict):  Check for a conflict between a dummy
        argument and an internal procedure name.

2015-05-19  Steven G. Kargl  <kargl@gcc.gnu.org>

        PR fortran/64925
        * gfortran.dg/pr64925.f90: New test.

Added:
    branches/gcc-5-branch/gcc/testsuite/gfortran.dg/pr64925.f90
Modified:
    branches/gcc-5-branch/gcc/fortran/ChangeLog
    branches/gcc-5-branch/gcc/fortran/symbol.c
    branches/gcc-5-branch/gcc/testsuite/ChangeLog


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

end of thread, other threads:[~2015-05-19 17:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-03 18:31 [Bug fortran/64925] New: ICE with same names for dummy arg and internal procedure longb at cray dot com
2015-02-03 20:10 ` [Bug fortran/64925] " kargl at gcc dot gnu.org
2015-02-03 20:47 ` longb at cray dot com
2015-05-18 19:26 ` kargl at gcc dot gnu.org
2015-05-19 17:02 ` kargl at gcc dot gnu.org
2015-05-19 17:02 ` kargl 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).