public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dominiq at lps dot ens dot fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/35680] [4.3/4.4 regression] ICE on invalid transfer in variable declaration
Date: Mon, 29 Sep 2008 20:26:00 -0000	[thread overview]
Message-ID: <20080929202531.22153.qmail@sourceware.org> (raw)
In-Reply-To: <bug-35680-10259@http.gcc.gnu.org/bugzilla/>



------- Comment #9 from dominiq at lps dot ens dot fr  2008-09-29 20:25 -------
Although I am not familiar with the gfortran code, gfc_array_size (mold, &tmp)I
think the reason why gfortran.dg/transfer_array_intrinsic_4.f90 fails with the
patch in comment #6,
is because gfc_array_size (mold, &tmp) looks at the size of mold, while the
relevant part of the TRANSFER definition is:

If SIZE is absent but MOLD is an array (of any size or shape), the result is a
one-dimensional array of the minimum length needed to contain the entirety of
the bitwise representation of SOURCE.

So I think tmp should contain
(number_of_bytes_in_SOURCE+size_in_bytes_of_a_MOLD_element-1)/size_in_bytes_of_a_MOLD_element.

Note that it would be interesting to test the code for [1_1], [1_2], [1_8], and
-fdefault-integer-8 to rule out side effects.

BTW I think the code in comment #0 is valid for both statement order: if 'real
x' is before TRANSFER, it value is not defined, but not necessary to get the
size; if 'real x' is after TRANSFER, x is implicitely defined as  real and I
think it is legal to confirm it by the 'real x' statement. At least the
following code

real :: y=epsilon(x)
real :: x
print *, y
end

is accepted by gfortran, ifort, and g95.


-- 


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


  parent reply	other threads:[~2008-09-29 20:26 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-24 18:45 [Bug fortran/35680] New: " fxcoudert at gcc dot gnu dot org
2008-03-25 20:46 ` [Bug fortran/35680] " pault at gcc dot gnu dot org
2008-03-25 23:18 ` burnus at gcc dot gnu dot org
2008-03-27 22:26 ` rguenth at gcc dot gnu dot org
2008-06-06 15:04 ` rguenth at gcc dot gnu dot org
2008-07-22 12:12 ` burnus at gcc dot gnu dot org
2008-08-27 22:08 ` jsm28 at gcc dot gnu dot org
2008-09-17  8:56 ` pault at gcc dot gnu dot org
2008-09-28 19:34 ` pault at gcc dot gnu dot org
2008-09-28 19:50 ` pault at gcc dot gnu dot org
2008-09-28 20:51 ` dominiq at lps dot ens dot fr
2008-09-29 20:26 ` dominiq at lps dot ens dot fr [this message]
2008-10-02 15:22 ` pault at gcc dot gnu dot org
2008-10-02 15:49 ` dominiq at lps dot ens dot fr
2008-10-03 12:14 ` pault at gcc dot gnu dot org
2008-10-03 22:24 ` dominiq at lps dot ens dot fr
2008-10-04 11:57 ` pault at gcc dot gnu dot org
2008-10-05 18:56 ` pault at gcc dot gnu dot org
2008-10-11 10:01 ` pault at gcc dot gnu dot org
2008-10-11 10:03 ` pault at gcc dot gnu dot 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=20080929202531.22153.qmail@sourceware.org \
    --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).