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/35681] wrong result for vector subscripted array expression in MVBITS
Date: Sat, 18 Oct 2008 09:32:00 -0000 [thread overview]
Message-ID: <20081018093112.29701.qmail@sourceware.org> (raw)
In-Reply-To: <bug-35681-15620@http.gcc.gnu.org/bugzilla/>
------- Comment #8 from dominiq at lps dot ens dot fr 2008-10-18 09:31 -------
(In reply to comment #7)
> This prints "2 2" at the moment, which seems quite reasonable to me; or does
> the standard enforce it should print "2 1"?
ifort returns "2 2" and g95 "2 1". As far as I understand the scalarization of
elemental procedures, I think g95 is right. Considering the following
modification of the code:
PROGRAM main
IMPLICIT NONE
INTEGER :: i, a(2), b(2)
a = (/ 1, 2 /)
b = (/ 2, 1 /)
CALL copy (a((/ 2, 1 /)), a)
PRINT *, a
a = (/ 1, 2 /)
do i = 1, 2
CALL copy (a(b(i)), a(i))
end do
PRINT *, a
a = (/ 1, 2 /)
do i = 2, 1, -1
CALL copy (a(b(i)), a(i))
end do
PRINT *, a
STOP
CONTAINS
ELEMENTAL SUBROUTINE copy (a, b)
IMPLICIT NONE
INTEGER, INTENT(IN) :: a
INTEGER, INTENT(OUT) :: b
b = a
END SUBROUTINE copy
END PROGRAM main
which gives:
2 1
2 2
2 2
1 1
i.e., a result depending on the order of the scalar do loop, my understanding
is that a temporary is required.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35681
next prev parent reply other threads:[~2008-10-18 9:32 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-24 19:40 [Bug fortran/35681] New: " dick dot hendrickson at gmail dot com
2008-03-24 22:13 ` [Bug fortran/35681] " burnus at gcc dot gnu dot org
2008-03-28 15:19 ` fxcoudert at gcc dot gnu dot org
2008-03-28 15:29 ` dominiq at lps dot ens dot fr
2008-03-28 15:49 ` dick dot hendrickson at gmail dot com
2008-03-28 16:22 ` dominiq at lps dot ens dot fr
2008-10-14 16:22 ` domob at gcc dot gnu dot org
2008-10-16 16:33 ` domob at gcc dot gnu dot org
2008-10-18 8:28 ` domob at gcc dot gnu dot org
2008-10-18 9:32 ` dominiq at lps dot ens dot fr [this message]
2008-10-18 10:22 ` burnus at gcc dot gnu dot org
2008-10-18 11:37 ` burnus at gcc dot gnu dot org
2008-10-18 17:03 ` dick dot hendrickson at gmail dot com
2008-10-19 14:35 ` pault at gcc dot gnu dot org
2008-10-19 14:48 ` domob at gcc dot gnu dot org
2008-10-19 16:17 ` domob at gcc dot gnu dot org
2008-11-01 13:29 ` domob at gcc dot gnu dot org
2008-11-01 13:38 ` domob at gcc dot gnu dot org
2008-11-13 17:18 ` domob at gcc dot gnu dot org
2008-11-14 13:03 ` mikael at gcc dot gnu dot org
2008-11-16 22:47 ` mikael at gcc dot gnu dot org
2008-11-23 19:09 ` burnus at gcc dot gnu dot org
2008-11-24 12:16 ` mikael at gcc dot gnu dot org
2008-11-24 12:27 ` mikael at gcc dot gnu dot org
2008-11-24 12:40 ` mikael at gcc dot gnu dot org
2008-11-24 12:49 ` mikael at gcc dot gnu dot org
2008-11-24 13:11 ` mikael at gcc dot gnu dot org
2008-11-24 19:16 ` pault at gcc dot gnu dot org
2009-01-04 19:12 ` mikael at gcc dot gnu dot org
2009-01-14 20:53 ` mikael at gcc dot gnu dot org
2009-01-29 17:35 ` hjl dot tools at gmail dot com
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=20081018093112.29701.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).