public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/54917] New: transfer on polymorphic variable causes ICE (gfc_target_expr_size)
@ 2012-10-12 19:22 quantheory at gmail dot com
  2012-10-12 21:31 ` [Bug fortran/54917] [OOP] TRANSFER on polymorphic variable causes ICE janus at gcc dot gnu.org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: quantheory at gmail dot com @ 2012-10-12 19:22 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 54917
           Summary: transfer on polymorphic variable causes ICE
                    (gfc_target_expr_size)
    Classification: Unclassified
           Product: gcc
           Version: 4.7.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: quantheory@gmail.com


Created attachment 28436
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28436
Short program that causes the bug

When compiling a routine that uses transfer on a polymorphic variable, the
following command fails:

gfortran -c -Wsurprising test_module.F90

The error message is:



test_module.F90:18.22:

end module test_module
                      1
Internal Error at (1):
Invalid expression in gfc_target_expr_size.



This error does not occur if -Wsurprising is off and the polymorphic variable
is the "source". It does occur if the polymorphic variable is the "mold", even
with no warnings on.


Obviously, you would rarely-or-never want to actually do such a transfer, but I
did notice this problem because I have been using the following macro to turn
off warnings about unused arguments:

#define UNUSED_VAR(arg) if (.false.) write(*,*) transfer(arg,1)

A bit hack-ish, but gets the job done in impure routines. In any case, even if
gfortran rejects this, getting a specific error message rather than an internal
error would be nice.


I'm in a somewhat limited environment right now, so I can't tell for sure
whether this is an old problem or a regression. This has happened with one of
the 4.7.3 unofficial prerelease builds:

gcc-4.7 -v
Using built-in specs.
COLLECT_GCC=gcc-4.7
COLLECT_LTO_WRAPPER=/home/santos/gcc-4.7/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.7.3/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.7-source/gcc-4.7-20120929/configure
--enable-languages=c,c++,fortran --enable-checking=release --disable-bootstrap
--disable-libmudflap --enable-libgomp --enable-lto --enable-gold
--with-plugin-ld=/usr/bin/gold --prefix=/usr/local/gcc-4.7
Thread model: posix


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

end of thread, other threads:[~2012-11-06 22:52 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-12 19:22 [Bug fortran/54917] New: transfer on polymorphic variable causes ICE (gfc_target_expr_size) quantheory at gmail dot com
2012-10-12 21:31 ` [Bug fortran/54917] [OOP] TRANSFER on polymorphic variable causes ICE janus at gcc dot gnu.org
2012-10-12 21:56 ` [Bug fortran/54917] [4.7/4.8 Regression] " dominiq at lps dot ens.fr
2012-10-12 22:06 ` dominiq at lps dot ens.fr
2012-10-13 10:01 ` janus at gcc dot gnu.org
2012-10-13 10:05 ` janus at gcc dot gnu.org
2012-10-13 10:12 ` dominiq at lps dot ens.fr
2012-10-13 13:08 ` janus at gcc dot gnu.org
2012-10-13 21:52 ` janus at gcc dot gnu.org
2012-10-14 11:15 ` janus at gcc dot gnu.org
2012-10-14 12:01 ` janus at gcc dot gnu.org
2012-10-14 12:02 ` janus at gcc dot gnu.org
2012-10-14 15:55 ` janus at gcc dot gnu.org
2012-10-14 15:56 ` janus at gcc dot gnu.org
2012-10-14 16:31 ` janus at gcc dot gnu.org
2012-10-14 22:56 ` janus at gcc dot gnu.org
2012-11-06 10:16 ` janus at gcc dot gnu.org
2012-11-06 22:45 ` janus at gcc dot gnu.org
2012-11-06 22:52 ` janus 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).