public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/51550] New: ICE in gfc_get_derived_type, at fortran/trans-types.c:2401
@ 2011-12-14 10:01 arjen.markus at deltares dot nl
  2011-12-14 10:29 ` [Bug fortran/51550] " dominiq at lps dot ens.fr
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: arjen.markus at deltares dot nl @ 2011-12-14 10:01 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51550
           Summary: ICE in gfc_get_derived_type, at
                    fortran/trans-types.c:2401
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: arjen.markus@deltares.nl


Created attachment 26078
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26078
Program causing the ICE

The attached program causes an ICE in gfc_get_derived_type, at
fortran/trans-types.c:2401, both in version 4.6.2 and 4.7.0 20111212 (a very
recent nightly build). The reported location is the same.

It may be related to other reported bugs vis-a-vis gfc_get_derived_type, but
as far as I can tell, they concern a different location in the source file.

The report is:

Driving: gfortran -v -o json json_problem.f90 -l gfortran -shared-libgcc
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=d:/gfortran47/bin/../libexec/gcc/i586-pc-mingw32/4.7.0/lto-wrapper.exe
Target: i586-pc-mingw32
Configured with: ../gcc-trunk/configure --prefix=/mingw
--enable-languages=c,fortran --with-gmp=/home/brad/gfortran/dependencies
--disable-werror --enable-threads --disable-nls --build=i586-pc-mingw32
--enable-libgomp --enable-shared --disable-win32-registry --with-dwarf2
--disable-sjlj-exceptions --enable-lto
Thread model: win32
gcc version 4.7.0 20111212 (experimental) [trunk revision 182257] (GCC) 
COLLECT_GCC_OPTIONS='-v' '-o' 'json.exe' '-shared-libgcc' '-mtune=pentium'
'-march=pentium'
 d:/gfortran47/bin/../libexec/gcc/i586-pc-mingw32/4.7.0/f951.exe
json_problem.f90 -quiet -dumpbase json_problem.f90 -mtune=pentium
-march=pentium -auxbase json_problem -version -fintrinsic-modules-path
d:/gfortran47/bin/../lib/gcc/i586-pc-mingw32/4.7.0/finclude -o
e:\Temp\cc481Bzh.s
GNU Fortran (GCC) version 4.7.0 20111212 (experimental) [trunk revision 182257]
(i586-pc-mingw32)
    compiled by GNU C version 4.7.0 20111212 (experimental) [trunk revision
182257], GMP version 5.0.2, MPFR version 3.1.0, MPC version 0.9
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU Fortran (GCC) version 4.7.0 20111212 (experimental) [trunk revision 182257]
(i586-pc-mingw32)
    compiled by GNU C version 4.7.0 20111212 (experimental) [trunk revision
182257], GMP version 5.0.2, MPFR version 3.1.0, MPC version 0.9
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
json_problem.f90:50:0: internal compiler error: in gfc_get_derived_type, at
fortran/trans-types.c:2401
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Regards,

Arjen


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

* [Bug fortran/51550] ICE in gfc_get_derived_type, at fortran/trans-types.c:2401
  2011-12-14 10:01 [Bug fortran/51550] New: ICE in gfc_get_derived_type, at fortran/trans-types.c:2401 arjen.markus at deltares dot nl
@ 2011-12-14 10:29 ` dominiq at lps dot ens.fr
  2011-12-15 15:21 ` burnus at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: dominiq at lps dot ens.fr @ 2011-12-14 10:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2011-12-14 10:26:05 UTC ---
I think it is a duplicate of pr47545, pr48654, pr49050, pr51075, and pr51393
(note that only pr48654 is marked as a duplicate of pr47545; if there is an
agreement about it, I can mark the other PRs as duplicate). From
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49050#c2 :

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] 6+ messages in thread

* [Bug fortran/51550] ICE in gfc_get_derived_type, at fortran/trans-types.c:2401
  2011-12-14 10:01 [Bug fortran/51550] New: ICE in gfc_get_derived_type, at fortran/trans-types.c:2401 arjen.markus at deltares dot nl
  2011-12-14 10:29 ` [Bug fortran/51550] " dominiq at lps dot ens.fr
@ 2011-12-15 15:21 ` burnus at gcc dot gnu.org
  2011-12-15 15:26 ` burnus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-12-15 15:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-12-15 15:18:38 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] 6+ messages in thread

* [Bug fortran/51550] ICE in gfc_get_derived_type, at fortran/trans-types.c:2401
  2011-12-14 10:01 [Bug fortran/51550] New: ICE in gfc_get_derived_type, at fortran/trans-types.c:2401 arjen.markus at deltares dot nl
  2011-12-14 10:29 ` [Bug fortran/51550] " dominiq at lps dot ens.fr
  2011-12-15 15:21 ` burnus at gcc dot gnu.org
@ 2011-12-15 15:26 ` burnus at gcc dot gnu.org
  2012-01-24  8:10 ` burnus at gcc dot gnu.org
  2015-03-17 16:23 ` vehre at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-12-15 15:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-12-15 15:25:37 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] 6+ messages in thread

* [Bug fortran/51550] ICE in gfc_get_derived_type, at fortran/trans-types.c:2401
  2011-12-14 10:01 [Bug fortran/51550] New: ICE in gfc_get_derived_type, at fortran/trans-types.c:2401 arjen.markus at deltares dot nl
                   ` (2 preceding siblings ...)
  2011-12-15 15:26 ` burnus at gcc dot gnu.org
@ 2012-01-24  8:10 ` burnus at gcc dot gnu.org
  2015-03-17 16:23 ` vehre at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-01-24  8:10 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |burnus at gcc dot gnu.org
         Resolution|                            |DUPLICATE

--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-01-24 08:04:45 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] 6+ messages in thread

* [Bug fortran/51550] ICE in gfc_get_derived_type, at fortran/trans-types.c:2401
  2011-12-14 10:01 [Bug fortran/51550] New: ICE in gfc_get_derived_type, at fortran/trans-types.c:2401 arjen.markus at deltares dot nl
                   ` (3 preceding siblings ...)
  2012-01-24  8:10 ` burnus at gcc dot gnu.org
@ 2015-03-17 16:23 ` vehre at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: vehre at gcc dot gnu.org @ 2015-03-17 16:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51550

vehre at gcc dot gnu.org changed:

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

--- Comment #6 from vehre at gcc dot gnu.org ---
I am working on fixing the remaining issue open to resolve this problem
completely. During inspection of your code I figured, that the implementation
of add_key_only () does not work. I had to change it this way:

subroutine add_key_only( json_object, key )
    type(json_data), target   :: json_object
    character(len=*)          :: key

    type(json_value), pointer :: value
    type(json_value), pointer :: last

    last => json_object%key_value
    if (associated (last)) then
        do while ( associated(last%next) )
           write(*,*) 'Key found: ', last%key
           last => last%next
        enddo
    end if

    allocate( value )
    allocate( character(len=len(key)) :: value%key )
    value%key = key

    write(*,*) 'Inserting key: ', value%key, ', len: ', len(value%key)
    if (associated (last)) then
        last%next => value
    else
        json_object%key_value => value
    end if

end subroutine add_key_only

Which now works as expected.


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

end of thread, other threads:[~2015-03-17 16:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-14 10:01 [Bug fortran/51550] New: ICE in gfc_get_derived_type, at fortran/trans-types.c:2401 arjen.markus at deltares dot nl
2011-12-14 10:29 ` [Bug fortran/51550] " dominiq at lps dot ens.fr
2011-12-15 15:21 ` burnus at gcc dot gnu.org
2011-12-15 15:26 ` burnus at gcc dot gnu.org
2012-01-24  8:10 ` burnus at gcc dot gnu.org
2015-03-17 16:23 ` vehre 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).