public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/38252]  New: Empty function with CONTAINS triggers Internal Error
@ 2008-11-24 18:00 domob at gcc dot gnu dot org
  2008-11-24 22:54 ` [Bug fortran/38252] " mikael at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: domob at gcc dot gnu dot org @ 2008-11-24 18:00 UTC (permalink / raw)
  To: gcc-bugs

This program gives an "Internal Error" pointing at the CONTAINS:

INTEGER FUNCTION test ()
CONTAINS
END FUNCTION test

It works with gfortran 4.3.1.  Replacing the FUNCTION by a SUBROUTINE gets rid
of the error.  Additionally, this program also works:

FUNCTION test ()
  INTEGER :: test
CONTAINS
END FUNCTION test


-- 
           Summary: Empty function with CONTAINS triggers Internal Error
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: domob at gcc dot gnu dot org


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


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

* [Bug fortran/38252] Empty function with CONTAINS triggers Internal Error
  2008-11-24 18:00 [Bug fortran/38252] New: Empty function with CONTAINS triggers Internal Error domob at gcc dot gnu dot org
@ 2008-11-24 22:54 ` mikael at gcc dot gnu dot org
  2008-11-24 23:13 ` mikael at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mikael at gcc dot gnu dot org @ 2008-11-24 22:54 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1406 bytes --]



------- Comment #1 from mikael at gcc dot gnu dot org  2008-11-24 22:52 -------
confirm

quickfix:
Index: parse.c
===================================================================
--- parse.c     (révision 142172)
+++ parse.c     (copie de travail)
@@ -2323,7 +2323,7 @@ parse_spec (gfc_statement st)
       gfc_symbol* proc = gfc_current_ns->proc_name;
       gcc_assert (proc);

-      if (proc->result->ts.type == BT_UNKNOWN)
+      if (proc->result->ts.type != BT_UNKNOWN)
        function_result_typed = true;
     }

@@ -2333,7 +2333,7 @@ loop:
      (and thus we can expect to see none any further), type the function
result
      if it has not yet been typed.  Be careful not to give the END statement
      to verify_st_order!  */
-  if (!function_result_typed && st != ST_GET_FCN_CHARACTERISTICS)
+  if (!function_result_typed && st == ST_GET_FCN_CHARACTERISTICS)
     {
       bool verify_now = false;


I'm probably missing something


-- 

mikael 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         |2008-11-24 22:52:46
               date|                            |


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


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

* [Bug fortran/38252] Empty function with CONTAINS triggers Internal Error
  2008-11-24 18:00 [Bug fortran/38252] New: Empty function with CONTAINS triggers Internal Error domob at gcc dot gnu dot org
  2008-11-24 22:54 ` [Bug fortran/38252] " mikael at gcc dot gnu dot org
@ 2008-11-24 23:13 ` mikael at gcc dot gnu dot org
  2008-11-25  6:46 ` [Bug fortran/38252] [4.4 Regression] " burnus at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mikael at gcc dot gnu dot org @ 2008-11-24 23:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from mikael at gcc dot gnu dot org  2008-11-24 23:12 -------
(In reply to comment #1)
> I'm probably missing something
> 
Indeed I was. :'(
FAIL: gfortran.dg/actual_array_result_1.f90


-- 


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


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

* [Bug fortran/38252] [4.4 Regression] Empty function with CONTAINS triggers Internal Error
  2008-11-24 18:00 [Bug fortran/38252] New: Empty function with CONTAINS triggers Internal Error domob at gcc dot gnu dot org
  2008-11-24 22:54 ` [Bug fortran/38252] " mikael at gcc dot gnu dot org
  2008-11-24 23:13 ` mikael at gcc dot gnu dot org
@ 2008-11-25  6:46 ` burnus at gcc dot gnu dot org
  2008-11-26 17:23 ` pault at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-11-25  6:46 UTC (permalink / raw)
  To: gcc-bugs



-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
            Summary|Empty function with CONTAINS|[4.4 Regression] Empty
                   |triggers Internal Error     |function with CONTAINS
                   |                            |triggers Internal Error
   Target Milestone|---                         |4.4.0


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


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

* [Bug fortran/38252] [4.4 Regression] Empty function with CONTAINS triggers Internal Error
  2008-11-24 18:00 [Bug fortran/38252] New: Empty function with CONTAINS triggers Internal Error domob at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-11-25  6:46 ` [Bug fortran/38252] [4.4 Regression] " burnus at gcc dot gnu dot org
@ 2008-11-26 17:23 ` pault at gcc dot gnu dot org
  2008-11-26 18:04 ` mikael at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pault at gcc dot gnu dot org @ 2008-11-26 17:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pault at gcc dot gnu dot org  2008-11-26 17:22 -------
(In reply to comment #2)

I am on my travels right now and only have 4.4.0 20080624 on my laptop.  The
testcase works fine with that, so this regression has crept in since then.

Cheers

Paul


-- 


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


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

* [Bug fortran/38252] [4.4 Regression] Empty function with CONTAINS triggers Internal Error
  2008-11-24 18:00 [Bug fortran/38252] New: Empty function with CONTAINS triggers Internal Error domob at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-11-26 17:23 ` pault at gcc dot gnu dot org
@ 2008-11-26 18:04 ` mikael at gcc dot gnu dot org
  2008-11-27 15:41 ` mikael at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mikael at gcc dot gnu dot org @ 2008-11-26 18:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from mikael at gcc dot gnu dot org  2008-11-26 18:02 -------
(In reply to comment #3)
> (In reply to comment #2)
> 
> I am on my travels right now and only have 4.4.0 20080624 on my laptop.  The
> testcase works fine with that, so this regression has crept in since then.

...or it is some changes on my tree I forgot to cleanup.

Did you manage to apply the patch without this?
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=139425

I will investigate more next week-end (unless someone beats me ;-)) 


-- 


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


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

* [Bug fortran/38252] [4.4 Regression] Empty function with CONTAINS triggers Internal Error
  2008-11-24 18:00 [Bug fortran/38252] New: Empty function with CONTAINS triggers Internal Error domob at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-11-26 18:04 ` mikael at gcc dot gnu dot org
@ 2008-11-27 15:41 ` mikael at gcc dot gnu dot org
  2008-12-01 19:33 ` mikael at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mikael at gcc dot gnu dot org @ 2008-11-27 15:41 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1576 bytes --]



------- Comment #5 from mikael at gcc dot gnu dot org  2008-11-27 15:40 -------
(In reply to comment #4)
> I will investigate more next week-end (unless someone beats me ;-)) 
> 
I'm investigating now.
The first patch was probably wrong. 
I'm testing this one at the moment:
Index: parse.c
===================================================================
--- parse.c     (r�vision 142242)
+++ parse.c     (copie de travail)
@@ -1576,7 +1576,7 @@ typedef struct
 {
   enum
   { ORDER_START, ORDER_USE, ORDER_IMPORT, ORDER_IMPLICIT_NONE,
-    ORDER_IMPLICIT, ORDER_SPEC, ORDER_EXEC
+    ORDER_IMPLICIT, ORDER_SPEC, ORDER_EXEC, ORDER_CONTAINS
   }
   state;
   gfc_statement last_statement;
@@ -1658,6 +1658,10 @@ verify_st_order (st_state *p, gfc_statement st, bo
        p->state = ORDER_EXEC;
       break;

+    case ST_CONTAINS:
+      p->state = ORDER_CONTAINS;
+      break;
+
     default:
       gfc_internal_error ("Unexpected %s statement in verify_st_order() at
%C",
                          gfc_ascii_statement (st));


-- 

mikael at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |mikael at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-11-24 22:52:46         |2008-11-27 15:40:17
               date|                            |


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


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

* [Bug fortran/38252] [4.4 Regression] Empty function with CONTAINS triggers Internal Error
  2008-11-24 18:00 [Bug fortran/38252] New: Empty function with CONTAINS triggers Internal Error domob at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2008-11-27 15:41 ` mikael at gcc dot gnu dot org
@ 2008-12-01 19:33 ` mikael at gcc dot gnu dot org
  2008-12-01 19:54 ` mikael at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mikael at gcc dot gnu dot org @ 2008-12-01 19:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from mikael at gcc dot gnu dot org  2008-12-01 19:32 -------
Subject: Bug 38252

Author: mikael
Date: Mon Dec  1 19:30:55 2008
New Revision: 142327

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142327
Log:
2008-12-01  Mikael Morin  <mikael.morin@tele2.fr>

        PR fortran/38252
        * parse.c (parse_spec): Skip statement order check in case
        of a CONTAINS statement.

2008-12-01  Mikael Morin  <mikael.morin@tele2.fr>

        PR fortran/38252
        * gfortran.dg/empty_function_1.f90: New test.


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


-- 


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


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

* [Bug fortran/38252] [4.4 Regression] Empty function with CONTAINS triggers Internal Error
  2008-11-24 18:00 [Bug fortran/38252] New: Empty function with CONTAINS triggers Internal Error domob at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2008-12-01 19:33 ` mikael at gcc dot gnu dot org
@ 2008-12-01 19:54 ` mikael at gcc dot gnu dot org
  2008-12-01 19:54 ` mikael at gcc dot gnu dot org
  2008-12-02 14:33 ` mikael at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: mikael at gcc dot gnu dot org @ 2008-12-01 19:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from mikael at gcc dot gnu dot org  2008-12-01 19:52 -------
I hope one day I'll be able to commit properly.


-- 


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


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

* [Bug fortran/38252] [4.4 Regression] Empty function with CONTAINS triggers Internal Error
  2008-11-24 18:00 [Bug fortran/38252] New: Empty function with CONTAINS triggers Internal Error domob at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2008-12-01 19:54 ` mikael at gcc dot gnu dot org
@ 2008-12-01 19:54 ` mikael at gcc dot gnu dot org
  2008-12-02 14:33 ` mikael at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: mikael at gcc dot gnu dot org @ 2008-12-01 19:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from mikael at gcc dot gnu dot org  2008-12-01 19:53 -------
Subject: Bug 38252

Author: mikael
Date: Mon Dec  1 19:52:15 2008
New Revision: 142331

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142331
Log:
2008-12-01  Mikael Morin  <mikael.morin@tele2.fr>

        PR fortran/38252
        * gfortran.dg/empty_function_1.f90: Fix latest commit.


Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/empty_function_1.f90


-- 


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


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

* [Bug fortran/38252] [4.4 Regression] Empty function with CONTAINS triggers Internal Error
  2008-11-24 18:00 [Bug fortran/38252] New: Empty function with CONTAINS triggers Internal Error domob at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2008-12-01 19:54 ` mikael at gcc dot gnu dot org
@ 2008-12-02 14:33 ` mikael at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: mikael at gcc dot gnu dot org @ 2008-12-02 14:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from mikael at gcc dot gnu dot org  2008-12-02 14:30 -------
Fixed on trunk.
Let's not forget to close.


-- 

mikael at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2008-12-02 14:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-24 18:00 [Bug fortran/38252] New: Empty function with CONTAINS triggers Internal Error domob at gcc dot gnu dot org
2008-11-24 22:54 ` [Bug fortran/38252] " mikael at gcc dot gnu dot org
2008-11-24 23:13 ` mikael at gcc dot gnu dot org
2008-11-25  6:46 ` [Bug fortran/38252] [4.4 Regression] " burnus at gcc dot gnu dot org
2008-11-26 17:23 ` pault at gcc dot gnu dot org
2008-11-26 18:04 ` mikael at gcc dot gnu dot org
2008-11-27 15:41 ` mikael at gcc dot gnu dot org
2008-12-01 19:33 ` mikael at gcc dot gnu dot org
2008-12-01 19:54 ` mikael at gcc dot gnu dot org
2008-12-01 19:54 ` mikael at gcc dot gnu dot org
2008-12-02 14:33 ` mikael 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).