public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/49050] New: ICE with deferred character length derived type component
@ 2011-05-18 18:16 kargl at gcc dot gnu.org
  2011-05-18 18:30 ` [Bug fortran/49050] " kargl at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: kargl at gcc dot gnu.org @ 2011-05-18 18:16 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: ICE with deferred character length derived type
                    component
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: kargl@gcc.gnu.org


The following code gives an ICE.  I haven't check it against
the standard yet to determine if this is valid or invalid 
code.  Nonetheless, it should not ICE.

module simple_module
   implicit none
   type :: item_type
     character(len=:), allocatable :: key
   end type item_type
end module simple_module

program test_simple
   use simple_module
   implicit none
   type(item_type) :: item
! ICE
   item = item_type('key')
!   item%key = 'key'
end program


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

* [Bug fortran/49050] ICE with deferred character length derived type component
  2011-05-18 18:16 [Bug fortran/49050] New: ICE with deferred character length derived type component kargl at gcc dot gnu.org
@ 2011-05-18 18:30 ` kargl at gcc dot gnu.org
  2011-05-18 18:51 ` burnus at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: kargl at gcc dot gnu.org @ 2011-05-18 18:30 UTC (permalink / raw)
  To: gcc-bugs

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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.6.1, 4.7.0

--- Comment #1 from kargl at gcc dot gnu.org 2011-05-18 18:04:23 UTC ---
ev.f90: In function 'test_simple':
ev.f90:8:0: internal compiler error: in gfc_get_derived_type, at
fortran/trans-types.c:2298
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

(gdb) bt
#0  gfc_get_derived_type (derived=0x202097380)
    at ../../gcc4x/gcc/fortran/trans-types.c:2325
#1  0x00000000005451cc in gfc_get_module_backend_decl (sym=0x202097700)
    at ../../gcc4x/gcc/fortran/trans-decl.c:690
#2  0x00000000005881eb in gfc_get_derived_type (derived=0x202097700)
    at ../../gcc4x/gcc/fortran/trans-types.c:2216
#3  0x0000000000588752 in gfc_typenode_for_spec (spec=0x202097c60)
    at ../../gcc4x/gcc/fortran/trans-types.c:1049
#4  0x000000000058888b in gfc_sym_type (sym=0x202097c40)
    at ../../gcc4x/gcc/fortran/trans-types.c:1983
#5  0x00000000005498e5 in gfc_get_symbol_decl (sym=0x202097c40)
    at ../../gcc4x/gcc/fortran/trans-decl.c:1303
#6  0x000000000054a722 in generate_local_decl (sym=0x202097c40)
    at ../../gcc4x/gcc/fortran/trans-decl.c:4207
#7  0x00000000005155de in traverse_ns (st=0x2020073d0, 
    func=0x54a460 <generate_local_decl>)
    at ../../gcc4x/gcc/fortran/symbol.c:3333
#8  0x00000000005155cf in traverse_ns (st=0x202007310, 
    func=0x54a460 <generate_local_decl>)
    at ../../gcc4x/gcc/fortran/symbol.c:3330
#9  0x00000000005155cf in traverse_ns (st=0x202007340, 
    func=0x54a460 <generate_local_decl>)
    at ../../gcc4x/gcc/fortran/symbol.c:3330
#10 0x000000000054c834 in gfc_generate_function_code (ns=0x2021ab600)
    at ../../gcc4x/gcc/fortran/trans-decl.c:4900
#11 0x00000000004ed9da in gfc_parse_file ()
    at ../../gcc4x/gcc/fortran/parse.c:4271
#12 0x000000000052466e in gfc_be_parse_file ()
    at ../../gcc4x/gcc/fortran/f95-lang.c:250
#13 0x0000000000877ca2 in do_compile () at ../../gcc4x/gcc/toplev.c:570
#14 0x00000000008788c5 in toplev_main (argc=2, argv=0x7fffffffd508)

(gdb) list
2321            {
2322              if (c->ts.type == BT_CHARACTER)
2323                {
2324                  /* Evaluate the string length.  */
2325                  gfc_conv_const_charlen (c->ts.u.cl);
2326                  gcc_assert (c->ts.u.cl->backend_decl);
2327                }
2328
2329              field_type = gfc_typenode_for_spec (&c->ts);
2330            }

(gdb) print c->ts.u.cl->backend_decl
$6 = 0x0
(gdb) print *c->ts.u.cl
$8 = {length = 0x0, next = 0x0, length_from_typespec = 0 '\0', 
  backend_decl = 0x0, passed_length = 0x0, resolved = 1}


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

* [Bug fortran/49050] ICE with deferred character length derived type component
  2011-05-18 18:16 [Bug fortran/49050] New: ICE with deferred character length derived type component kargl at gcc dot gnu.org
  2011-05-18 18:30 ` [Bug fortran/49050] " kargl at gcc dot gnu.org
@ 2011-05-18 18:51 ` burnus at gcc dot gnu.org
  2011-05-18 18:58 ` burnus at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-05-18 18:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-05-18 18:31:39 UTC ---
For a variant (original, longer version), see:
  http://gcc.gnu.org/ml/fortran/2011-05/msg00129.html

(That program compiles and runs w/o valgrind errors with ifort 11.1)


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

* [Bug fortran/49050] ICE with deferred character length derived type component
  2011-05-18 18:16 [Bug fortran/49050] New: ICE with deferred character length derived type component kargl at gcc dot gnu.org
  2011-05-18 18:30 ` [Bug fortran/49050] " kargl at gcc dot gnu.org
  2011-05-18 18:51 ` burnus at gcc dot gnu.org
@ 2011-05-18 18:58 ` burnus at gcc dot gnu.org
  2011-12-15 15:20 ` burnus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-05-18 18:58 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-05-18 18:29:49 UTC ---
See also: PR 45170.

It is known that deferred character length components do not work - they have
not been implemented. I think we really should add a gfc_error("Sorry not
implemented") as it is not the first such bug has been reported.

 * * *

By the way, the documentation states this - albeit a bit hidden:

http://gcc.gnu.org/gcc-4.6/changes.html#fortran
http://gcc.gnu.org/wiki/GFortran#GCC4.6
 "Deferred type parameter: For scalar allocatable and pointer variables
  the character length can be deferred."
 (In particular: For components and for arrays, the length cannot be deferred.)

And a bit more explicitly:
  http://gcc.gnu.org/wiki/Fortran2003Status
  http://gcc.gnu.org/onlinedocs/gfortran/Fortran-2003-status.html


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

* [Bug fortran/49050] ICE with deferred character length derived type component
  2011-05-18 18:16 [Bug fortran/49050] New: ICE with deferred character length derived type component kargl at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2011-05-18 18:58 ` burnus at gcc dot gnu.org
@ 2011-12-15 15:20 ` burnus at gcc dot gnu.org
  2011-12-15 15:41 ` burnus at gcc dot gnu.org
  2012-01-24  8:09 ` burnus at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-12-15 15:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-12-15 15:18:39 UTC ---
Author: burnus
Date: Thu Dec 15 15:18:33 2011
New Revision: 182372

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

        PR fortran/51550
        PR fortran/47545
        PR fortran/49050
        PR fortran/51075
        * resolve.c (resolve_fl_derived0): Print not-implemented error
        for deferred-length character components.


Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/resolve.c


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

* [Bug fortran/49050] ICE with deferred character length derived type component
  2011-05-18 18:16 [Bug fortran/49050] New: ICE with deferred character length derived type component kargl at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2011-12-15 15:20 ` burnus at gcc dot gnu.org
@ 2011-12-15 15:41 ` burnus at gcc dot gnu.org
  2012-01-24  8:09 ` burnus at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-12-15 15:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-12-15 15:25:39 UTC ---
Author: burnus
Date: Thu Dec 15 15:25:32 2011
New Revision: 182373

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

        PR fortran/51550
        PR fortran/47545
        PR fortran/49050
        PR fortran/51075
        * resolve.c (resolve_fl_derived0): Print not-implemented error
        for deferred-length character components.


Modified:
    branches/gcc-4_6-branch/gcc/fortran/ChangeLog
    branches/gcc-4_6-branch/gcc/fortran/resolve.c


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

* [Bug fortran/49050] ICE with deferred character length derived type component
  2011-05-18 18:16 [Bug fortran/49050] New: ICE with deferred character length derived type component kargl at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2011-12-15 15:41 ` burnus at gcc dot gnu.org
@ 2012-01-24  8:09 ` burnus at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-01-24  8:09 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-01-24 08:04:35 UTC ---
The ICE is fixed - but deferred-length character components are not supported:
Instead of an internal compiler error, one now gets a "not yet implemented"
error.

Its implementation of is now tracked at PR 51976.

*** This bug has been marked as a duplicate of bug 51976 ***


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

end of thread, other threads:[~2012-01-24  8:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-18 18:16 [Bug fortran/49050] New: ICE with deferred character length derived type component kargl at gcc dot gnu.org
2011-05-18 18:30 ` [Bug fortran/49050] " kargl at gcc dot gnu.org
2011-05-18 18:51 ` burnus at gcc dot gnu.org
2011-05-18 18:58 ` burnus at gcc dot gnu.org
2011-12-15 15:20 ` burnus at gcc dot gnu.org
2011-12-15 15:41 ` burnus at gcc dot gnu.org
2012-01-24  8:09 ` 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).