public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/32724]  New: ICE on statement function in specfication part of module
@ 2007-07-10 18:28 dfranke at gcc dot gnu dot org
  2007-07-14 10:49 ` [Bug fortran/32724] ICE on statement function in specification " pault at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-07-10 18:28 UTC (permalink / raw)
  To: gcc-bugs

$> cat ice.f90
MODULE stmt
f(x) = x**2        ! invalid
END MODULE

PROGRAM xx
  USE stmt
  print *, f(3)
END PROGRAM

$> gfortran-svn -g -Wall stmt.f90
stmt.f90:7.13:

  print *, f(3)
            1
Error: Type/rank mismatch in argument 'x' at (1)
stmt.f90:7.10:

  print *, f(3)
         1
stmt.f90:0: internal compiler error: Segmentation fault


Backtrace:
Program received signal SIGSEGV, Segmentation fault.
error_string (p=0x0) at ../../../gcc/gcc/fortran/error.c:110
110       while (*p)
(gdb) bt
#0  error_string (p=0x0) at ../../../gcc/gcc/fortran/error.c:110
#1  0x08063909 in error_print (type=0x8722662 "Error:", format0=0x872f870
"Function '%s' at %L cannot call itself, as it is not RECURSIVE",
    argp=<value optimized out>) at ../../../gcc/gcc/fortran/error.c:565
#2  0x08063ed4 in gfc_error (nocmsgid=0x872f870 "Function '%s' at %L cannot
call itself, as it is not RECURSIVE") at ../../../gcc/gcc/fortran/error.c:759
#3  0x0809be96 in gfc_resolve_expr (e=0x8934a88) at
../../../gcc/gcc/fortran/resolve.c:2074
#4  0x0809f326 in resolve_code (code=0x8934af8, ns=0x8934200) at
../../../gcc/gcc/fortran/resolve.c:5711
#5  0x080a290a in gfc_resolve_blocks (b=0x8934b38, ns=0x8934200) at
../../../gcc/gcc/fortran/resolve.c:5644
#6  0x0809f30c in resolve_code (code=0x8934bb8, ns=0x8934200) at
../../../gcc/gcc/fortran/resolve.c:5703
#7  0x080a0e1c in resolve_codes (ns=0x8934200) at
../../../gcc/gcc/fortran/resolve.c:8399
#8  0x080a0e53 in gfc_resolve (ns=0x8934200) at
../../../gcc/gcc/fortran/resolve.c:8418
#9  0x080932d0 in gfc_parse_file () at ../../../gcc/gcc/fortran/parse.c:3263
#10 0x080b879d in gfc_be_parse_file (set_yydebug=0) at
../../../gcc/gcc/fortran/f95-lang.c:301
#11 0x0832a5b8 in toplev_main (argc=2, argv=0xbff8ad44) at
../../../gcc/gcc/toplev.c:1051
#12 0x080ffdcf in main (argc=1869771333, argv=0x46203a72) at
../../../gcc/gcc/main.c:35


$> gfortran-svn -v
gcc version 4.3.0 20070710 (experimental)


-- 
           Summary: ICE on statement function in specfication part of module
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dfranke at gcc dot gnu dot org


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


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

* [Bug fortran/32724] ICE on statement function in specification part of module
  2007-07-10 18:28 [Bug fortran/32724] New: ICE on statement function in specfication part of module dfranke at gcc dot gnu dot org
@ 2007-07-14 10:49 ` pault at gcc dot gnu dot org
  2007-07-14 11:08 ` dfranke at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-07-14 10:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pault at gcc dot gnu dot org  2007-07-14 10:49 -------
11.3 Modules
....
Constraint: A module specification-part shall not contain a stmt-function-stmt,
an entry-stmt, or a format-stmt.
....

This fixes it

Index: gcc/fortran/parse.c
===================================================================
*** gcc/fortran/parse.c (revision 126598)
--- gcc/fortran/parse.c (working copy)
*************** loop:
*** 1902,1907 ****
--- 1902,1914 ----

          break;

+       case ST_STATEMENT_FUNCTION:
+         if (gfc_current_state () == COMP_MODULE)
+           {
+             unexpected_statement (st);
+             break;
+           }
+
        default:
          break;
        }

I cannot do anything about it right now - it'll have to be one one weeks's
time.  If anybody wants to run with it, please do.

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-07-14 10:49:34
               date|                            |


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


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

* [Bug fortran/32724] ICE on statement function in specification part of module
  2007-07-10 18:28 [Bug fortran/32724] New: ICE on statement function in specfication part of module dfranke at gcc dot gnu dot org
  2007-07-14 10:49 ` [Bug fortran/32724] ICE on statement function in specification " pault at gcc dot gnu dot org
@ 2007-07-14 11:08 ` dfranke at gcc dot gnu dot org
  2007-07-14 13:34 ` dfranke at gcc dot gnu dot org
  2007-07-14 13:34 ` dfranke at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-07-14 11:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from dfranke at gcc dot gnu dot org  2007-07-14 11:08 -------
Paul,
thanks for the patch!
I'll regtest, submit to the ML and commit after approval.


-- 


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


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

* [Bug fortran/32724] ICE on statement function in specification part of module
  2007-07-10 18:28 [Bug fortran/32724] New: ICE on statement function in specfication part of module dfranke at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-07-14 13:34 ` dfranke at gcc dot gnu dot org
@ 2007-07-14 13:34 ` dfranke at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-07-14 13:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from dfranke at gcc dot gnu dot org  2007-07-14 13:34 -------
Done. Closing.


-- 

dfranke at gcc dot gnu dot org changed:

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


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


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

* [Bug fortran/32724] ICE on statement function in specification part of module
  2007-07-10 18:28 [Bug fortran/32724] New: ICE on statement function in specfication part of module dfranke at gcc dot gnu dot org
  2007-07-14 10:49 ` [Bug fortran/32724] ICE on statement function in specification " pault at gcc dot gnu dot org
  2007-07-14 11:08 ` dfranke at gcc dot gnu dot org
@ 2007-07-14 13:34 ` dfranke at gcc dot gnu dot org
  2007-07-14 13:34 ` dfranke at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-07-14 13:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from dfranke at gcc dot gnu dot org  2007-07-14 13:34 -------
Subject: Bug 32724

Author: dfranke
Date: Sat Jul 14 13:33:51 2007
New Revision: 126638

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126638
Log:
gcc/fortran:
2007-07-14  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/32724
        * parse.c (parse_spec): Emit error on unexpected statement
        function.

gcc/testsuite:
2007-07-14  Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/32724
        * gfortran.dg/stfunc_5.f90: New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/stfunc_5.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/parse.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

end of thread, other threads:[~2007-07-14 13:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-10 18:28 [Bug fortran/32724] New: ICE on statement function in specfication part of module dfranke at gcc dot gnu dot org
2007-07-14 10:49 ` [Bug fortran/32724] ICE on statement function in specification " pault at gcc dot gnu dot org
2007-07-14 11:08 ` dfranke at gcc dot gnu dot org
2007-07-14 13:34 ` dfranke at gcc dot gnu dot org
2007-07-14 13:34 ` dfranke 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).