public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "quantheory at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/54917] New: transfer on polymorphic variable causes ICE (gfc_target_expr_size)
Date: Fri, 12 Oct 2012 19:22:00 -0000	[thread overview]
Message-ID: <bug-54917-4@http.gcc.gnu.org/bugzilla/> (raw)


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


             reply	other threads:[~2012-10-12 19:22 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-12 19:22 quantheory at gmail dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-54917-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).