public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/33664]  New: crash on invalid program
@ 2007-10-05  9:50 holst at matmech dot com
  2007-10-05  9:51 ` [Bug fortran/33664] " holst at matmech dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: holst at matmech dot com @ 2007-10-05  9:50 UTC (permalink / raw)
  To: gcc-bugs

gfortran crashes on the compile of the following (invalid) Fortran module.

There are two obvious faults with the program:
1. there is no intent
2. there is no dimension to N


-- 
           Summary: crash on invalid program
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: holst at matmech dot com
 GCC build triplet: x86_64-unknown-linux
  GCC host triplet: x86_64-unknown-linux
GCC target triplet: x86_64-unknown-linux


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


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

* [Bug fortran/33664] crash on invalid program
  2007-10-05  9:50 [Bug fortran/33664] New: crash on invalid program holst at matmech dot com
@ 2007-10-05  9:51 ` holst at matmech dot com
  2007-10-05 11:15 ` fxcoudert at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: holst at matmech dot com @ 2007-10-05  9:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from holst at matmech dot com  2007-10-05 09:51 -------
Created an attachment (id=14301)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14301&action=view)
invalid program which crashes latest trunk (gcc (GCC) 4.3.0 20070927
(experimental) [trunk revision 128829])

test.f:0: internal compiler error: Segmentation fault


-- 


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


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

* [Bug fortran/33664] crash on invalid program
  2007-10-05  9:50 [Bug fortran/33664] New: crash on invalid program holst at matmech dot com
  2007-10-05  9:51 ` [Bug fortran/33664] " holst at matmech dot com
@ 2007-10-05 11:15 ` fxcoudert at gcc dot gnu dot org
  2007-10-06 11:14 ` pault at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-10-05 11:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from fxcoudert at gcc dot gnu dot org  2007-10-05 11:15 -------
Confirmed. Reduced testcase:

$ cat a.f90
module test
contains
  subroutine func_1(u,n)
    integer :: n, u(n(1))
  end subroutine
end module test
$ gfortran a.f90
f951: internal compiler error: Segmentation fault

This is a module writing problem, as confirmed by the backtrace:

#0  0x00000000004448d6 in mio_expr (ep=0x0)
    at ../../../trunk/gcc/fortran/module.c:2794
#1  0x00000000004454bc in mio_array_spec (asp=<value optimized out>)
    at ../../../trunk/gcc/fortran/module.c:1934
#2  0x0000000000445a89 in mio_symbol (sym=0xf592b0)
    at ../../../trunk/gcc/fortran/module.c:3067
#3  0x00000000004461f9 in write_symbol (n=5, sym=0xf592b0)
    at ../../../trunk/gcc/fortran/module.c:3902
#4  0x000000000044638d in write_symbol1 (p=0xf5ae90)
    at ../../../trunk/gcc/fortran/module.c:3969
#5  0x0000000000446355 in write_symbol1 (p=0xf5a110)
    at ../../../trunk/gcc/fortran/module.c:3962
#6  0x0000000000446332 in write_symbol1 (p=0xf5afc0)
    at ../../../trunk/gcc/fortran/module.c:3960
#7  0x0000000000447e71 in gfc_dump_module (name=<value optimized out>,
    dump_flag=1) at ../../../trunk/gcc/fortran/module.c:4106


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fxcoudert at gcc dot gnu dot
                   |                            |org
           Severity|minor                       |normal
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
  GCC build triplet|x86_64-unknown-linux        |paulthomas
   GCC host triplet|x86_64-unknown-linux        |
 GCC target triplet|x86_64-unknown-linux        |
           Keywords|                            |ice-on-invalid-code
      Known to fail|                            |4.3.0
   Last reconfirmed|0000-00-00 00:00:00         |2007-10-05 11:15:04
               date|                            |


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


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

* [Bug fortran/33664] crash on invalid program
  2007-10-05  9:50 [Bug fortran/33664] New: crash on invalid program holst at matmech dot com
  2007-10-05  9:51 ` [Bug fortran/33664] " holst at matmech dot com
  2007-10-05 11:15 ` fxcoudert at gcc dot gnu dot org
@ 2007-10-06 11:14 ` pault at gcc dot gnu dot org
  2007-10-07 19:15 ` patchapp at dberlin dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-10-06 11:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pault at gcc dot gnu dot org  2007-10-06 11:14 -------
This fails in execution, for the same reason:

  call func_1((/1,2/), 1)
contains
  subroutine func_1(u,n)
    integer :: n, u(n(1))
    print *, u
  end subroutine
end

n is determined to be a function and so must be pure, since it is in a
specification expression.

Fixing this, causes char_result_7.f90 to fail.  g95 and lahey agree that this
is wrong.  I'll submit something soon... ie. just as soon as it has stopped
regtesting.

Cheers

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pault at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-10-05 11:15:04         |2007-10-06 11:14:40
               date|                            |


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


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

* [Bug fortran/33664] crash on invalid program
  2007-10-05  9:50 [Bug fortran/33664] New: crash on invalid program holst at matmech dot com
                   ` (2 preceding siblings ...)
  2007-10-06 11:14 ` pault at gcc dot gnu dot org
@ 2007-10-07 19:15 ` patchapp at dberlin dot org
  2007-10-12 16:46 ` pault at gcc dot gnu dot org
  2007-10-14 19:28 ` pault at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: patchapp at dberlin dot org @ 2007-10-07 19:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from patchapp at dberlin dot org  2007-10-07 19:15 -------
Subject: Bug number PR33664

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2007-10/msg00375.html


-- 


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


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

* [Bug fortran/33664] crash on invalid program
  2007-10-05  9:50 [Bug fortran/33664] New: crash on invalid program holst at matmech dot com
                   ` (3 preceding siblings ...)
  2007-10-07 19:15 ` patchapp at dberlin dot org
@ 2007-10-12 16:46 ` pault at gcc dot gnu dot org
  2007-10-14 19:28 ` pault at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-10-12 16:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pault at gcc dot gnu dot org  2007-10-12 16:45 -------
Subject: Bug 33664

Author: pault
Date: Fri Oct 12 16:45:46 2007
New Revision: 129267

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129267
Log:
2007-10-12  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/33664
        * expr.c (gfc_specification_expr): If a function is not
        external, intrinsic or pure is an error.  Set the symbol pure
        to prevent repeat errors.

2007-10-12  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/33664
        * gfortran.dg/impure_spec_expr_1.f90: New test.
        * gfortran.dg/char_result_7.f90: Remove illegal test.


Added:
    trunk/gcc/testsuite/gfortran.dg/impure_spec_expr_1.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/expr.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/char_result_7.f90


-- 


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


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

* [Bug fortran/33664] crash on invalid program
  2007-10-05  9:50 [Bug fortran/33664] New: crash on invalid program holst at matmech dot com
                   ` (4 preceding siblings ...)
  2007-10-12 16:46 ` pault at gcc dot gnu dot org
@ 2007-10-14 19:28 ` pault at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-10-14 19:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pault at gcc dot gnu dot org  2007-10-14 19:27 -------
Fixed on trunk.

Thanks for the report.

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2007-10-14 19:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-05  9:50 [Bug fortran/33664] New: crash on invalid program holst at matmech dot com
2007-10-05  9:51 ` [Bug fortran/33664] " holst at matmech dot com
2007-10-05 11:15 ` fxcoudert at gcc dot gnu dot org
2007-10-06 11:14 ` pault at gcc dot gnu dot org
2007-10-07 19:15 ` patchapp at dberlin dot org
2007-10-12 16:46 ` pault at gcc dot gnu dot org
2007-10-14 19:28 ` pault 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).