public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/40743]  New: [4.5 Regression] ICE when compiling iso_varying_string.f95 at revision 149591
@ 2009-07-14  8:54 dominiq at lps dot ens dot fr
  2009-07-14  9:46 ` [Bug fortran/40743] " burnus at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: dominiq at lps dot ens dot fr @ 2009-07-14  8:54 UTC (permalink / raw)
  To: gcc-bugs

At revision 149591, compiling iso_varying_string.f95 gives the following error:

[ibook-dhum] f90/bug% gfc -c iso_varying_string.f95
iso_varying_string.f95:2548.29:

end module iso_varying_string
                             1
Internal Error at (1):
resolve_code(): Bad statement code

Probably due (or uncovered) by revision 149586.

Note that the same error occurs when compiling the codes in pr40440#0 and
pr40440#2.


-- 
           Summary: [4.5 Regression] ICE when compiling
                    iso_varying_string.f95 at revision 149591
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dominiq at lps dot ens dot fr


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


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

* [Bug fortran/40743] [4.5 Regression] ICE when compiling iso_varying_string.f95 at revision 149591
  2009-07-14  8:54 [Bug fortran/40743] New: [4.5 Regression] ICE when compiling iso_varying_string.f95 at revision 149591 dominiq at lps dot ens dot fr
@ 2009-07-14  9:46 ` burnus at gcc dot gnu dot org
  2009-07-14  9:47 ` burnus at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-07-14  9:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from burnus at gcc dot gnu dot org  2009-07-14 09:46 -------
> Probably due (or uncovered) by revision 149586

That's: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149586
2009-07-13  Janus Weil  <janus@gcc.gnu.org>
        PR fortran/40646


-- 


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


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

* [Bug fortran/40743] [4.5 Regression] ICE when compiling iso_varying_string.f95 at revision 149591
  2009-07-14  8:54 [Bug fortran/40743] New: [4.5 Regression] ICE when compiling iso_varying_string.f95 at revision 149591 dominiq at lps dot ens dot fr
  2009-07-14  9:46 ` [Bug fortran/40743] " burnus at gcc dot gnu dot org
@ 2009-07-14  9:47 ` burnus at gcc dot gnu dot org
  2009-07-14 10:54 ` dominiq at lps dot ens dot fr
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-07-14  9:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from burnus at gcc dot gnu dot org  2009-07-14 09:47 -------
> [ibook-dhum] f90/bug% gfc -c iso_varying_string.f95

I assume that's the file: http://www.fortran.com/iso_varying_string.f95


-- 


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


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

* [Bug fortran/40743] [4.5 Regression] ICE when compiling iso_varying_string.f95 at revision 149591
  2009-07-14  8:54 [Bug fortran/40743] New: [4.5 Regression] ICE when compiling iso_varying_string.f95 at revision 149591 dominiq at lps dot ens dot fr
  2009-07-14  9:46 ` [Bug fortran/40743] " burnus at gcc dot gnu dot org
  2009-07-14  9:47 ` burnus at gcc dot gnu dot org
@ 2009-07-14 10:54 ` dominiq at lps dot ens dot fr
  2009-07-14 13:20 ` janus at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dominiq at lps dot ens dot fr @ 2009-07-14 10:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from dominiq at lps dot ens dot fr  2009-07-14 10:54 -------
> I assume that's the file: http://www.fortran.com/iso_varying_string.f95

yes.


-- 


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


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

* [Bug fortran/40743] [4.5 Regression] ICE when compiling iso_varying_string.f95 at revision 149591
  2009-07-14  8:54 [Bug fortran/40743] New: [4.5 Regression] ICE when compiling iso_varying_string.f95 at revision 149591 dominiq at lps dot ens dot fr
                   ` (2 preceding siblings ...)
  2009-07-14 10:54 ` dominiq at lps dot ens dot fr
@ 2009-07-14 13:20 ` janus at gcc dot gnu dot org
  2009-07-14 13:38 ` janus at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-07-14 13:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from janus at gcc dot gnu dot org  2009-07-14 13:20 -------
Here is a minimal test case:

  implicit none

  type :: varying_string
  end type

  interface assignment(=)
     procedure op_assign_VS_CH
  end interface

contains

  subroutine op_assign_VS_CH (var, exp)
    type(varying_string), intent(out) :: var
    character(LEN=*), intent(in)      :: exp
  end subroutine

  subroutine split_VS
    type(varying_string) :: string
    call split_CH(string)
  end subroutine

  subroutine split_CH (string)
    type(varying_string) :: string
    string = ""
  end subroutine

end


-- 

janus 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         |2009-07-14 13:20:29
               date|                            |


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


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

* [Bug fortran/40743] [4.5 Regression] ICE when compiling iso_varying_string.f95 at revision 149591
  2009-07-14  8:54 [Bug fortran/40743] New: [4.5 Regression] ICE when compiling iso_varying_string.f95 at revision 149591 dominiq at lps dot ens dot fr
                   ` (3 preceding siblings ...)
  2009-07-14 13:20 ` janus at gcc dot gnu dot org
@ 2009-07-14 13:38 ` janus at gcc dot gnu dot org
  2009-07-14 13:50 ` janus at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-07-14 13:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from janus at gcc dot gnu dot org  2009-07-14 13:38 -------
Backtrace for the code in comment #4:

#0  resolve_code (code=0x2f26580, ns=0x2f25520) at
/home/jweil/gcc45/trunk/gcc/fortran/resolve.c:7168
#1  0x0000000000512703 in resolve_codes (ns=0x2f25520) at
/home/jweil/gcc45/trunk/gcc/fortran/resolve.c:10966
#2  0x0000000000512640 in resolve_codes (ns=0x2f1f4f0) at
/home/jweil/gcc45/trunk/gcc/fortran/resolve.c:10956
#3  0x00000000005127ef in gfc_resolve (ns=0x2f1f4f0) at
/home/jweil/gcc45/trunk/gcc/fortran/resolve.c:10990
#4  0x0000000000506280 in gfc_parse_file () at
/home/jweil/gcc45/trunk/gcc/fortran/parse.c:3924
#5  0x000000000053af15 in gfc_be_parse_file (set_yydebug=0) at
/home/jweil/gcc45/trunk/gcc/fortran/f95-lang.c:241
#6  0x000000000098408d in compile_file () at
/home/jweil/gcc45/trunk/gcc/toplev.c:1026
#7  0x0000000000986232 in do_compile () at
/home/jweil/gcc45/trunk/gcc/toplev.c:2346
#8  0x0000000000986302 in toplev_main (argc=2, argv=0x7fff2fc770a8) at
/home/jweil/gcc45/trunk/gcc/toplev.c:2391
#9  0x00000000005ab99b in main (argc=2, argv=0x7fff2fc770a8) at
/home/jweil/gcc45/trunk/gcc/main.c:35


-- 


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


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

* [Bug fortran/40743] [4.5 Regression] ICE when compiling iso_varying_string.f95 at revision 149591
  2009-07-14  8:54 [Bug fortran/40743] New: [4.5 Regression] ICE when compiling iso_varying_string.f95 at revision 149591 dominiq at lps dot ens dot fr
                   ` (4 preceding siblings ...)
  2009-07-14 13:38 ` janus at gcc dot gnu dot org
@ 2009-07-14 13:50 ` janus at gcc dot gnu dot org
  2009-07-14 16:54 ` janus at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-07-14 13:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from janus at gcc dot gnu dot org  2009-07-14 13:50 -------
The error goes away with the following patch:

Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c       (revision 149623)
+++ gcc/fortran/resolve.c       (working copy)
@@ -9845,20 +9845,6 @@ resolve_symbol (gfc_symbol *sym)
   if (sym->formal_ns && sym->formal_ns != gfc_current_ns)
     gfc_resolve (sym->formal_ns);

-  /* Make sure the formal namespace is present.  */
-  if (sym->formal && !sym->formal_ns)
-    {
-      gfc_formal_arglist *formal = sym->formal;
-      while (formal && !formal->sym)
-       formal = formal->next;
-
-      if (formal)
-       {
-         sym->formal_ns = formal->sym->ns;
-         sym->formal_ns->refs++;
-       }
-    }
-
   /* Check threadprivate restrictions.  */
   if (sym->attr.threadprivate && !sym->attr.save && !sym->ns->save_all
       && (!sym->attr.in_common

However, I don't quite see the connection yet. Also, this will regress e.g. on
proc_ptr_22.f90 (which is the reason why I added this hunk for PR40646).


-- 


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


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

* [Bug fortran/40743] [4.5 Regression] ICE when compiling iso_varying_string.f95 at revision 149591
  2009-07-14  8:54 [Bug fortran/40743] New: [4.5 Regression] ICE when compiling iso_varying_string.f95 at revision 149591 dominiq at lps dot ens dot fr
                   ` (5 preceding siblings ...)
  2009-07-14 13:50 ` janus at gcc dot gnu dot org
@ 2009-07-14 16:54 ` janus at gcc dot gnu dot org
  2009-07-15  7:29 ` steven at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-07-14 16:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from janus at gcc dot gnu dot org  2009-07-14 16:53 -------
Here is a much better patch:

Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c       (revision 149623)
+++ gcc/fortran/resolve.c       (working copy)
@@ -9842,7 +9842,8 @@ resolve_symbol (gfc_symbol *sym)
   formal_arg_flag = 0;

   /* Resolve formal namespaces.  */
-  if (sym->formal_ns && sym->formal_ns != gfc_current_ns)
+  if (sym->formal_ns && sym->formal_ns != gfc_current_ns
+      && !sym->attr.contained)
     gfc_resolve (sym->formal_ns);

   /* Make sure the formal namespace is present.  */

At least this works for iso_varying_string.f90 and the procptr test cases.
Starting a full regtest now.


-- 

janus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |janus at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2009-07-14 13:20:29         |2009-07-14 16:53:59
               date|                            |


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


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

* [Bug fortran/40743] [4.5 Regression] ICE when compiling iso_varying_string.f95 at revision 149591
  2009-07-14  8:54 [Bug fortran/40743] New: [4.5 Regression] ICE when compiling iso_varying_string.f95 at revision 149591 dominiq at lps dot ens dot fr
                   ` (6 preceding siblings ...)
  2009-07-14 16:54 ` janus at gcc dot gnu dot org
@ 2009-07-15  7:29 ` steven at gcc dot gnu dot org
  2009-07-15  8:42 ` janus at gcc dot gnu dot org
  2009-07-15  8:47 ` janus at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: steven at gcc dot gnu dot org @ 2009-07-15  7:29 UTC (permalink / raw)
  To: gcc-bugs



-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.5.0


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


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

* [Bug fortran/40743] [4.5 Regression] ICE when compiling iso_varying_string.f95 at revision 149591
  2009-07-14  8:54 [Bug fortran/40743] New: [4.5 Regression] ICE when compiling iso_varying_string.f95 at revision 149591 dominiq at lps dot ens dot fr
                   ` (7 preceding siblings ...)
  2009-07-15  7:29 ` steven at gcc dot gnu dot org
@ 2009-07-15  8:42 ` janus at gcc dot gnu dot org
  2009-07-15  8:47 ` janus at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-07-15  8:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from janus at gcc dot gnu dot org  2009-07-15 08:41 -------
Subject: Bug 40743

Author: janus
Date: Wed Jul 15 08:41:29 2009
New Revision: 149662

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149662
Log:
2009-07-15  Janus Weil  <janus@gcc.gnu.org>

        PR fortran/40743
        * resolve.c (resolve_symbol): Don't resolve the formal namespace of a
        contained procedure.


2009-07-15  Janus Weil  <janus@gcc.gnu.org>

        PR fortran/40743
        * gfortran.dg/interface_assignment_4.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/interface_assignment_4.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/resolve.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/40743] [4.5 Regression] ICE when compiling iso_varying_string.f95 at revision 149591
  2009-07-14  8:54 [Bug fortran/40743] New: [4.5 Regression] ICE when compiling iso_varying_string.f95 at revision 149591 dominiq at lps dot ens dot fr
                   ` (8 preceding siblings ...)
  2009-07-15  8:42 ` janus at gcc dot gnu dot org
@ 2009-07-15  8:47 ` janus at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-07-15  8:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from janus at gcc dot gnu dot org  2009-07-15 08:47 -------
Fixed with r149662. Closing.


-- 

janus at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2009-07-15  8:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-14  8:54 [Bug fortran/40743] New: [4.5 Regression] ICE when compiling iso_varying_string.f95 at revision 149591 dominiq at lps dot ens dot fr
2009-07-14  9:46 ` [Bug fortran/40743] " burnus at gcc dot gnu dot org
2009-07-14  9:47 ` burnus at gcc dot gnu dot org
2009-07-14 10:54 ` dominiq at lps dot ens dot fr
2009-07-14 13:20 ` janus at gcc dot gnu dot org
2009-07-14 13:38 ` janus at gcc dot gnu dot org
2009-07-14 13:50 ` janus at gcc dot gnu dot org
2009-07-14 16:54 ` janus at gcc dot gnu dot org
2009-07-15  7:29 ` steven at gcc dot gnu dot org
2009-07-15  8:42 ` janus at gcc dot gnu dot org
2009-07-15  8:47 ` janus 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).