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: Fri, 03 Oct 2008 22:24:00 -0000	[thread overview]
Message-ID: <20081003222306.2636.qmail@sourceware.org> (raw)
In-Reply-To: <bug-35680-10259@http.gcc.gnu.org/bugzilla/>



------- Comment #13 from dominiq at lps dot ens dot fr  2008-10-03 22:23 -------
> Happily, I have come to the conclusion that the code is invalid no matter which
> order the declarations come in;
> ....
> (a) a restricted expression or
> (b) a variable whose properties inquired about are not
> the TRANSFER (x, [1]) argument is manifestly not consistent with (b) and should
> fail by (a) with exactly the g95 message.

After having knotted my neurones, I agree with that: size(transfer(x, [1])) is
not a "restricted expression".

> I will make it so.

Good!

> In fact the ICE is precisely due to the argument not being a restricted
> expression, since the size of x and its kind are unavailable to the caller and
> the interfacing cannot be made to work.  This is why restricted expressions
> only permit dummy, host- or use-associated or common variables and why my
> attempts to evaluate the transfer are failing.

However I disagree with this part of the analysis:

size(transfer(real(1.0,kind(x)), [1_1])) is a "restricted expression" (happily
accepted by gfortran) that uses exactly the same information as
size(transfer(x, [1])) as shown by the following code:

program main
  print *, foo()
  print *, size(transfer(real(1.0,kind(x)), [1_1])),&
           size(transfer(x, [1_1]))
  if (size(foo()) /= kind(x)) call abort()
contains
  function foo()
    integer foo(size(transfer(real(1.0,kind(x)), [1_1])))
    real x
    foo=transfer(real(1.0,kind(x)), [1_1])
  end function
end program

giving on intel machines (without the patch in comment #6)

           0           0        -128          63
           4           4

(with the patch the second line is 4 1) or

           0           0           0           0           0           0       
 -16          63
           8           8

when compiled with -fdefault-real-8. On ppc I get

          63        -128           0           0
           4           4

and

          63         -16           0           0           0           0       
   0           0
           8           8


-- 


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


  parent reply	other threads:[~2008-10-03 22:24 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
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 [this message]
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=20081003222306.2636.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).