public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/54714] New: ICE on invalid expression involving DT with allocatable components and constructor in I/O
@ 2012-09-26  8:56 xarthisius.kk at gmail dot com
  2012-09-26  9:09 ` [Bug fortran/54714] " burnus at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: xarthisius.kk at gmail dot com @ 2012-09-26  8:56 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 54714
           Summary: ICE on invalid expression involving DT with
                    allocatable components and constructor in I/O
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: xarthisius.kk@gmail.com


Hi,
following code:
program foo
   type :: na_var
      integer, allocatable, dimension(:) :: x
   end type na_var
   write(*,*) na_var([2,2])
end

gives ICE with 

xarth@janus01 ~ $ gfortran -v
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.0-pre9999/gfortran
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.8.0-pre9999/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-4.8.0_pre9999/work/gcc-4.8.0-9999/configure
--prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.0-pre9999
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0-pre9999/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.0-pre9999
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.0-pre9999/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.0-pre9999/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0-pre9999/include/g++-v4
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec
--disable-fixed-point --without-ppl --without-cloog --enable-lto --enable-nls
--without-included-gettext --with-system-zlib --enable-obsolete
--disable-werror --enable-secureplt --enable-multilib
--with-multilib-list=m32,m64 --enable-libmudflap --disable-libssp
--enable-libgomp
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.8.0-pre9999/python
--enable-checking=yes --disable-libgcj --enable-languages=c,c++,fortran
--enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-clocale=gnu --enable-targets=all --with-bugurl=http://bugs.gentoo.org/
--with-pkgversion='Gentoo 4.8.0_pre9999'
Thread model: posix
gcc version 4.8.0-pre9999 20120922 (experimental) commit
f09a218261ba473738ad45f2c643957523019a17 (Gentoo 4.8.0_pre9999)

For the reference, this bug is a variation of PR41859


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

* [Bug fortran/54714] ICE on invalid expression involving DT with allocatable components and constructor in I/O
  2012-09-26  8:56 [Bug fortran/54714] New: ICE on invalid expression involving DT with allocatable components and constructor in I/O xarthisius.kk at gmail dot com
@ 2012-09-26  9:09 ` burnus at gcc dot gnu.org
  2015-04-16  8:42 ` vehre at gcc dot gnu.org
  2015-04-16  9:16 ` dominiq at lps dot ens.fr
  2 siblings, 0 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-09-26  9:09 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-09-26
                 CC|                            |burnus at gcc dot gnu.org
     Ever Confirmed|0                           |1

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-09-26 09:08:45 UTC ---
 Invalid read of size 4
    at 0x57EB174: __gmpz_sub (in /usr/lib64/libgmp.so.10.0.5)
    by 0x6540BE: transfer_array_component(tree_node*, gfc_component*, locus*)
(trans-io.c:1963)
    by 0x653C0E: transfer_expr(gfc_se*, gfc_typespec*, tree_node*, gfc_code*)
(trans-io.c:2168)
    by 0x6570E7: gfc_trans_transfer(gfc_code*) (trans-io.c:2308)


But the actual problem is that it isn't already rejected at resolving time; the
code is invalid.

"If a list item of derived type in a formatted input/output statement is not
processed by a defined input/output procedure, that list item is treated as if
all of the components of the list item were specified in the list in component
order; those components shall be accessible in the scoping unit containing the
input/output statement and shall not be pointers or allocatable."

(F2008, "9.6.3 Data transfer input/output list" paragraph 7, list item below
"NOTE 9.34")


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

* [Bug fortran/54714] ICE on invalid expression involving DT with allocatable components and constructor in I/O
  2012-09-26  8:56 [Bug fortran/54714] New: ICE on invalid expression involving DT with allocatable components and constructor in I/O xarthisius.kk at gmail dot com
  2012-09-26  9:09 ` [Bug fortran/54714] " burnus at gcc dot gnu.org
@ 2015-04-16  8:42 ` vehre at gcc dot gnu.org
  2015-04-16  9:16 ` dominiq at lps dot ens.fr
  2 siblings, 0 replies; 4+ messages in thread
From: vehre at gcc dot gnu.org @ 2015-04-16  8:42 UTC (permalink / raw)
  To: gcc-bugs

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

vehre at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |vehre at gcc dot gnu.org
         Resolution|---                         |FIXED

--- Comment #2 from vehre at gcc dot gnu.org ---
I stumbled over this bug, while looking for something different with
allocatable components. 

The ICE is fixed in gcc 6.0 instead the error message 

>>>
test_pr54714.f90:5:27:

    write(*,*) na_var([2,2])

Error: Data transfer element at (1) cannot have ALLOCATABLE components unless
it is processed by a defined input/output procedure
<<<

is printed. I deem the pr therefore as fixed.


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

* [Bug fortran/54714] ICE on invalid expression involving DT with allocatable components and constructor in I/O
  2012-09-26  8:56 [Bug fortran/54714] New: ICE on invalid expression involving DT with allocatable components and constructor in I/O xarthisius.kk at gmail dot com
  2012-09-26  9:09 ` [Bug fortran/54714] " burnus at gcc dot gnu.org
  2015-04-16  8:42 ` vehre at gcc dot gnu.org
@ 2015-04-16  9:16 ` dominiq at lps dot ens.fr
  2 siblings, 0 replies; 4+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-04-16  9:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> ...
> The ICE is fixed in gcc 6.0 instead the error message 
> ...
> is printed. I deem the pr therefore as fixed.

For the record, it has been fixed between revisions r220436 (2015-02-05, ICE)
and r220481+one patch (2015-02-06, error).


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

end of thread, other threads:[~2015-04-16  9:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-26  8:56 [Bug fortran/54714] New: ICE on invalid expression involving DT with allocatable components and constructor in I/O xarthisius.kk at gmail dot com
2012-09-26  9:09 ` [Bug fortran/54714] " burnus at gcc dot gnu.org
2015-04-16  8:42 ` vehre at gcc dot gnu.org
2015-04-16  9:16 ` dominiq at lps dot ens.fr

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).