public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/50408] New: ICE in transfer_expr
@ 2011-09-15  8:36 zeccav at gmail dot com
  2011-09-15 13:42 ` [Bug fortran/50408] " Joost.VandeVondele at pci dot uzh.ch
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: zeccav at gmail dot com @ 2011-09-15  8:36 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50408
           Summary: ICE in transfer_expr
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zeccav@gmail.com


Created attachment 25284
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25284
just compile it

ICE in transfer_expr


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

* [Bug fortran/50408] ICE in transfer_expr
  2011-09-15  8:36 [Bug fortran/50408] New: ICE in transfer_expr zeccav at gmail dot com
@ 2011-09-15 13:42 ` Joost.VandeVondele at pci dot uzh.ch
  2011-11-08 23:05 ` [Bug fortran/50408] [4.6/4.7 regression] " fxcoudert at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Joost.VandeVondele at pci dot uzh.ch @ 2011-09-15 13:42 UTC (permalink / raw)
  To: gcc-bugs

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

Joost VandeVondele <Joost.VandeVondele at pci dot uzh.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-09-15
     Ever Confirmed|0                           |1

--- Comment #1 from Joost VandeVondele <Joost.VandeVondele at pci dot uzh.ch> 2011-09-15 13:40:45 UTC ---
a beauty :-)

#0  internal_error (gmsgid=0x117c39a "in %s, at %s:%d") at
../../gcc/gcc/diagnostic.c:833
#1  0x0000000000e3f394 in fancy_abort (file=Unhandled dwarf expression opcode
0xf3
) at ../../gcc/gcc/diagnostic.c:893
#2  0x00000000005db4ce in transfer_expr (se=0x7fffffffd400, ts=Unhandled dwarf
expression opcode 0xf3
) at ../../gcc/gcc/fortran/trans-io.c:2156
#3  0x00000000005dfe31 in gfc_trans_transfer (code=0x16cf1e0) at
../../gcc/gcc/fortran/trans-io.c:2305
#4  0x00000000005956b8 in trans_code (code=0x16cf1e0, cond=0x7ffff7fef6f0) at
../../gcc/gcc/fortran/trans.c:1397
#5  0x00000000005dd90b in build_dt (function=0x7ffff5b4d200, code=0x16cf450) at
../../gcc/gcc/fortran/trans-io.c:1832
#6  0x00000000005dfbfd in gfc_trans_write (code=Unhandled dwarf expression
opcode 0xf3
) at ../../gcc/gcc/fortran/trans-io.c:1871
#7  0x00000000005956d8 in trans_code (code=0x16cf450, cond=0x0) at
../../gcc/gcc/fortran/trans.c:1369
#8  0x00000000005b999c in gfc_generate_function_code (ns=Unhandled dwarf
expression opcode 0xf3
) at ../../gcc/gcc/fortran/trans-decl.c:5211
#9  0x00000000005578c7 in translate_all_program_units () at
../../gcc/gcc/fortran/parse.c:4404
#10 gfc_parse_file () at ../../gcc/gcc/fortran/parse.c:4617
#11 0x0000000000590ac6 in gfc_be_parse_file () at
../../gcc/gcc/fortran/f95-lang.c:250


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

* [Bug fortran/50408] [4.6/4.7 regression] ICE in transfer_expr
  2011-09-15  8:36 [Bug fortran/50408] New: ICE in transfer_expr zeccav at gmail dot com
  2011-09-15 13:42 ` [Bug fortran/50408] " Joost.VandeVondele at pci dot uzh.ch
@ 2011-11-08 23:05 ` fxcoudert at gcc dot gnu.org
  2011-11-11 11:31 ` burnus at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2011-11-08 23:05 UTC (permalink / raw)
  To: gcc-bugs

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

Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
           Priority|P3                          |P1
   Last reconfirmed|2011-09-15 00:00:00         |2011-11-08 0:00
                 CC|                            |fxcoudert at gcc dot
                   |                            |gnu.org
            Summary|ICE in transfer_expr        |[4.6/4.7 regression] ICE in
                   |                            |transfer_expr

--- Comment #2 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> 2011-11-08 23:01:00 UTC ---
This one is actually a 4.6 and 4.7 regression. It runs fine on 4.3, 4.4 and
4.5. Reduced testcase:

module m
  type int
    integer :: val
  end type int
contains
  type(int) function foo()
    foo%val = 42
  end function foo
end module m

program p
  use m
  print *, foo()
end program p


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

* [Bug fortran/50408] [4.6/4.7 regression] ICE in transfer_expr
  2011-09-15  8:36 [Bug fortran/50408] New: ICE in transfer_expr zeccav at gmail dot com
  2011-09-15 13:42 ` [Bug fortran/50408] " Joost.VandeVondele at pci dot uzh.ch
  2011-11-08 23:05 ` [Bug fortran/50408] [4.6/4.7 regression] " fxcoudert at gcc dot gnu.org
@ 2011-11-11 11:31 ` burnus at gcc dot gnu.org
  2011-11-24 22:39 ` burnus at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-11-11 11:31 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P3
                 CC|                            |burnus at gcc dot gnu.org
   Target Milestone|---                         |4.6.3


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

* [Bug fortran/50408] [4.6/4.7 regression] ICE in transfer_expr
  2011-09-15  8:36 [Bug fortran/50408] New: ICE in transfer_expr zeccav at gmail dot com
                   ` (2 preceding siblings ...)
  2011-11-11 11:31 ` burnus at gcc dot gnu.org
@ 2011-11-24 22:39 ` burnus at gcc dot gnu.org
  2011-11-24 23:31 ` burnus at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-11-24 22:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-11-24 22:13:06 UTC ---
That a -fwhole-file regression, which became the default in 4.6. The work
around is -fno-whole-file.

The problem is in gfc_get_extern_function_decl:

      gfc_find_symbol (sym->name, gsym->ns, 0, &s);
      if (s && s->backend_decl)
        {
          sym->backend_decl = s->backend_decl;
          return sym->backend_decl;
        }

The problem is that this does not set
  sym->ts.u.derived{,->components{,->next}}->backend_decl
for BT_DERIVED/BT_CLASS; one might also need to update
  sym->ts.u.cl...
for BT_CHARACTER.

Note: There are more places in trans*.c which call gfc_find_gsymbol


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

* [Bug fortran/50408] [4.6/4.7 regression] ICE in transfer_expr
  2011-09-15  8:36 [Bug fortran/50408] New: ICE in transfer_expr zeccav at gmail dot com
                   ` (3 preceding siblings ...)
  2011-11-24 22:39 ` burnus at gcc dot gnu.org
@ 2011-11-24 23:31 ` burnus at gcc dot gnu.org
  2011-11-25 16:37 ` burnus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-11-24 23:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-11-24 22:20:55 UTC ---
Patch for this issue - note that there are more places which have to be checked
and potentially fixed. The second part is just a performance/algorithmic
optimization, which occurs in real code.

--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -1671,6 +1671,9 @@ gfc_get_extern_function_decl (gfc_symbol * sym)
       if (s && s->backend_decl)
        {
          sym->backend_decl = s->backend_decl;
+         if ((sym->ts.type == BT_DERIVED || sym->ts.type == BT_CLASS)
+             && sym->ts.u.derived->backend_decl == NULL)
+           gfc_get_derived_type (sym->ts.u.derived);
          return sym->backend_decl;
        }
     }
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -2188,6 +2188,9 @@ gfc_copy_dt_decls_ifequal (gfc_symbol *from, gfc_symbol
*to,
   gfc_component *to_cm;
   gfc_component *from_cm;

+  if (from == to)
+    return 1;
+
   if (from->backend_decl == NULL
        || !gfc_compare_derived_types (from, to))
     return 0;


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

* [Bug fortran/50408] [4.6/4.7 regression] ICE in transfer_expr
  2011-09-15  8:36 [Bug fortran/50408] New: ICE in transfer_expr zeccav at gmail dot com
                   ` (4 preceding siblings ...)
  2011-11-24 23:31 ` burnus at gcc dot gnu.org
@ 2011-11-25 16:37 ` burnus at gcc dot gnu.org
  2011-11-25 17:34 ` burnus at gcc dot gnu.org
  2011-11-25 17:36 ` burnus at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-11-25 16:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-11-25 16:27:01 UTC ---
Author: burnus
Date: Fri Nov 25 16:26:47 2011
New Revision: 181725

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181725
Log:
2011-11-25  Tobias Burnus  <burnus@net-b.de>

        PR fortran/50408
        * trans-decl.c (gfc_get_module_backend_decl): Also copy
        ts.u.derived from the gsym if the ts.type is BT_CLASS.
        (gfc_get_extern_function_decl): Copy also the backend_decl
        for the symbol's ts.u.{derived,cl} from the gsym.
        * trans-types.c (gfc_copy_dt_decls_ifequal): Directly
        return if "from" and "to" are the same.

2011-11-25  Tobias Burnus  <burnus@net-b.de>

        PR fortran/50408
        * gfortran.dg/whole_file_35.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/whole_file_35.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-decl.c
    trunk/gcc/fortran/trans-types.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug fortran/50408] [4.6/4.7 regression] ICE in transfer_expr
  2011-09-15  8:36 [Bug fortran/50408] New: ICE in transfer_expr zeccav at gmail dot com
                   ` (5 preceding siblings ...)
  2011-11-25 16:37 ` burnus at gcc dot gnu.org
@ 2011-11-25 17:34 ` burnus at gcc dot gnu.org
  2011-11-25 17:36 ` burnus at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-11-25 17:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-11-25 17:18:10 UTC ---
Author: burnus
Date: Fri Nov 25 17:18:05 2011
New Revision: 181726

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181726
Log:
2011-11-25  Tobias Burnus  <burnus@net-b.de>

        PR fortran/50408
        * trans-decl.c (gfc_get_module_backend_decl): Also copy
        ts.u.derived from the gsym if the ts.type is BT_CLASS.
        (gfc_get_extern_function_decl): Copy also the backend_decl
        for the symbol's ts.u.{derived,cl} from the gsym.
        * trans-types.c (gfc_copy_dt_decls_ifequal): Directly
        return if "from" and "to" are the same.

2011-11-25  Tobias Burnus  <burnus@net-b.de>

        PR fortran/50408
        * gfortran.dg/whole_file_35.f90: New.


Added:
    branches/gcc-4_6-branch/gcc/testsuite/gfortran.dg/whole_file_35.f90
Modified:
    branches/gcc-4_6-branch/gcc/fortran/ChangeLog
    branches/gcc-4_6-branch/gcc/fortran/trans-decl.c
    branches/gcc-4_6-branch/gcc/fortran/trans-types.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


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

* [Bug fortran/50408] [4.6/4.7 regression] ICE in transfer_expr
  2011-09-15  8:36 [Bug fortran/50408] New: ICE in transfer_expr zeccav at gmail dot com
                   ` (6 preceding siblings ...)
  2011-11-25 17:34 ` burnus at gcc dot gnu.org
@ 2011-11-25 17:36 ` burnus at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-11-25 17:36 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

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

--- Comment #7 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-11-25 17:18:49 UTC ---
FIXED on the trunk and on the 4.6 branch.

Thanks for the report!


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

end of thread, other threads:[~2011-11-25 17:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-15  8:36 [Bug fortran/50408] New: ICE in transfer_expr zeccav at gmail dot com
2011-09-15 13:42 ` [Bug fortran/50408] " Joost.VandeVondele at pci dot uzh.ch
2011-11-08 23:05 ` [Bug fortran/50408] [4.6/4.7 regression] " fxcoudert at gcc dot gnu.org
2011-11-11 11:31 ` burnus at gcc dot gnu.org
2011-11-24 22:39 ` burnus at gcc dot gnu.org
2011-11-24 23:31 ` burnus at gcc dot gnu.org
2011-11-25 16:37 ` burnus at gcc dot gnu.org
2011-11-25 17:34 ` burnus at gcc dot gnu.org
2011-11-25 17:36 ` burnus at gcc dot gnu.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).