public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/18923] New: segfault after subroutine name confusion
@ 2004-12-10 13:00 Thomas dot Koenig at online dot de
  2004-12-14 22:35 ` [Bug fortran/18923] " tobi at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 27+ messages in thread
From: Thomas dot Koenig at online dot de @ 2004-12-10 13:00 UTC (permalink / raw)
  To: gcc-bugs

The code below is invalid, but it's not that
bad that a segfault is called for :-)

$ cat sel_int_kind.f90
program foo
contains
  subroutine foo(i)
    integer :: i
    character(len=selected_int_kind(i)) :: c
  end subroutine bar
end program foo
$ gfortran sel_int_kind.f90
 In file sel_int_kind.f90:3

  subroutine foo(i)
               1
Error: PROGRAM attribute conflicts with PROCEDURE attribute at (1)
 In file sel_int_kind.f90:4

    integer :: i
               1
Error: Unexpected data declaration statement in CONTAINS section at (1)
 In file sel_int_kind.f90:5

    character(len=selected_int_kind(i)) :: c
                                           1
Error: Unexpected data declaration statement in CONTAINS section at (1)
 In file sel_int_kind.f90:6

  end subroutine bar
    1
Error: Expecting END PROGRAM statement at (1)
sel_int_kind.f90:0: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
$ gfortran -v
Reading specs from /home/zfkts/lib/gcc/ia64-unknown-linux-gnu/4.0.0/specs
Configured with: ../gcc-4.0-20041205/configure --prefix=/home/zfkts
--enable-languages=c,c++,f95 --disable-shared
Thread model: posix
gcc version 4.0.0 20041205 (experimental)

Here's a backtrace:

$ gdb ~/libexec/gcc/ia64-unknown-linux-gnu/4.0.0/f951
GNU gdb Red Hat Linux (6.1post-1.20040607.17rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "ia64-redhat-linux-gnu"...Using host libthread_db
library "/lib/tls/libthread_db.so.1".

(gdb) r sel_int_kind.f90
Starting program: /home/zfkts/libexec/gcc/ia64-unknown-linux-gnu/4.0.0/f951
sel_int_kind.f90
 In file sel_int_kind.f90:3

  subroutine foo(i)
               1
Error: PROGRAM attribute conflicts with PROCEDURE attribute at (1)
 In file sel_int_kind.f90:4

    integer :: i
               1
Error: Unexpected data declaration statement in CONTAINS section at (1)
 In file sel_int_kind.f90:5

    character(len=selected_int_kind(i)) :: c
                                           1
Error: Unexpected data declaration statement in CONTAINS section at (1)
 In file sel_int_kind.f90:6

  end subroutine bar
    1
Error: Expecting END PROGRAM statement at (1)

Program received signal SIGSEGV, Segmentation fault.
gfc_resolve_expr (e=0x60000000000e7200)
    at ../../gcc-4.0-20041205/gcc/fortran/resolve.c:2084
2084      if (sym->attr.flavor == FL_PROCEDURE && !sym->attr.function)
(gdb) bt
#0  gfc_resolve_expr (e=0x60000000000e7200)
    at ../../gcc-4.0-20041205/gcc/fortran/resolve.c:2084
#1  0x4000000000085fb0 in resolve_actual_arglist (arg=0x60000000000e6f10)
    at ../../gcc-4.0-20041205/gcc/fortran/resolve.c:604
#2  0x4000000000083f60 in gfc_resolve_expr (e=0x60000000000e6de0)
    at ../../gcc-4.0-20041205/gcc/fortran/resolve.c:942
#3  0x400000000008e090 in gfc_resolve (ns=0x60000000000e67f0)
    at ../../gcc-4.0-20041205/gcc/fortran/resolve.c:4666
#4  0x400000000008dff0 in gfc_resolve (ns=0x60000000000e5bd0)
    at ../../gcc-4.0-20041205/gcc/fortran/resolve.c:4658
#5  0x400000000007a520 in gfc_parse_file ()
    at ../../gcc-4.0-20041205/gcc/fortran/parse.c:2612
#6  0x40000000000adcb0 in gfc_be_parse_file (set_yydebug=-19536)
    at ../../gcc-4.0-20041205/gcc/fortran/f95-lang.c:266
#7  0x400000000063d760 in toplev_main (argc=Variable "argc" is not available.
)
    at ../../gcc-4.0-20041205/gcc/toplev.c:992
#8  0x4000000000106220 in main (argc=2, argv=0x60000fffffffb838)
    at ../../gcc-4.0-20041205/gcc/main.c:35

-- 
           Summary: segfault after subroutine name confusion
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: Thomas dot Koenig at online dot de
                CC: gcc-bugs at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 27+ messages in thread
[parent not found: <bug-18923-9515@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2007-06-06  1:23 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-10 13:00 [Bug fortran/18923] New: segfault after subroutine name confusion Thomas dot Koenig at online dot de
2004-12-14 22:35 ` [Bug fortran/18923] " tobi at gcc dot gnu dot org
2005-05-22 19:26 ` fxcoudert at gcc dot gnu dot org
2005-06-06  0:42 ` pinskia at gcc dot gnu dot org
2005-06-06  7:59 ` reichelt at gcc dot gnu dot org
2005-06-13  3:28 ` pinskia at gcc dot gnu dot org
2005-07-08  1:44 ` mmitchel at gcc dot gnu dot org
2005-09-18 20:02 ` pinskia at gcc dot gnu dot org
     [not found] <bug-18923-9515@http.gcc.gnu.org/bugzilla/>
2006-06-07  3:17 ` jvdelisle at gcc dot gnu dot org
2006-06-07  5:19 ` pinskia at gcc dot gnu dot org
2006-06-29 17:44 ` tobi at gcc dot gnu dot org
2006-07-03 18:35 ` reichelt at gcc dot gnu dot org
2006-10-20  3:26 ` jvdelisle at gcc dot gnu dot org
2007-02-01 20:28 ` reichelt at gcc dot gnu dot org
2007-02-02  2:26 ` jvdelisle at gcc dot gnu dot org
2007-05-18 10:06 ` dfranke at gcc dot gnu dot org
2007-05-18 20:10 ` reichelt at gcc dot gnu dot org
2007-05-18 20:44 ` dfranke at gcc dot gnu dot org
2007-05-18 21:11 ` dfranke at gcc dot gnu dot org
2007-05-18 21:53 ` jvdelisle at gcc dot gnu dot org
2007-05-18 22:53 ` jvdelisle at gcc dot gnu dot org
2007-05-21 15:25 ` patchapp at dberlin dot org
2007-05-23  4:16 ` jvdelisle at gcc dot gnu dot org
2007-06-02 21:10 ` patchapp at dberlin dot org
2007-06-05 20:24 ` jvdelisle at gcc dot gnu dot org
2007-06-06  1:21 ` jvdelisle at gcc dot gnu dot org
2007-06-06  1:23 ` jvdelisle 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).