public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kargl at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/44354] incorrect output at run time
Date: Mon, 31 May 2010 21:54:00 -0000	[thread overview]
Message-ID: <20100531215428.12254.qmail@sourceware.org> (raw)
In-Reply-To: <bug-44354-19262@http.gcc.gnu.org/bugzilla/>



------- Comment #11 from kargl at gcc dot gnu dot org  2010-05-31 21:54 -------
(In reply to comment #7)
> (In reply to comment #6)
> > because in the above 'i' and 'I' are in the same scoping unit.
> I couldn't find what mandates in the standard that i and I are in a different
> scoping unit/are different variables. Are they ?
> 
> > If you write 'i = 5; j = [(i,i=1,I)]' then the 'i' here is in
> > a different scoping unit.  I agree that the scalar-int-expr
> > '1' and 'I' need to be evaluated to establish the the loop
> > start and stop values.  The question again based on scoping
> > unit is whether 'I' is uninitialized.
> > 
> How could it be ?
> 

I don't understand what you are asking.

  integer j(5)
  I = 5
  j = (/ (i,i=1,I) /)  ! (i,i=m1,m2) for discussion below
  end 

'I' in line 2 is in the scope of the main program.
'i' in line 3 is in the scope of the implied-do-loop.
'I' in line 2 is not the same as 'i' in line 3.  The
only thing that 'i' in line 3 gets from 'I' in line 2
is its type and kind type parameter.  When 'i' in 
line 3 comes into scope, does 'I' in the m2 become
undefined?  I can't find anything in the standard
that states that it becomes undefined and I can't
find anywhere that states that it is still defined to
have a value of 5 in the evaluation of m2.


-- 


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


  parent reply	other threads:[~2010-05-31 21:54 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-31 16:32 [Bug fortran/44354] New: " zeccav at gmail dot com
2010-05-31 17:43 ` [Bug fortran/44354] " mikael at gcc dot gnu dot org
2010-05-31 18:01 ` dominiq at lps dot ens dot fr
2010-05-31 18:04 ` mikael at gcc dot gnu dot org
2010-05-31 18:34 ` kargl at gcc dot gnu dot org
2010-05-31 19:24 ` dominiq at lps dot ens dot fr
2010-05-31 20:02 ` kargl at gcc dot gnu dot org
2010-05-31 21:31 ` mikael at gcc dot gnu dot org
2010-05-31 21:34 ` mikael at gcc dot gnu dot org
2010-05-31 21:38 ` zeccav at gmail dot com
2010-05-31 21:39 ` mikael at gcc dot gnu dot org
2010-05-31 21:54 ` kargl at gcc dot gnu dot org [this message]
2010-05-31 22:47 ` kargl at gcc dot gnu dot org
2010-05-31 23:44 ` kargl at gcc dot gnu dot org
2010-06-01  2:09 ` jvdelisle at gcc dot gnu dot org
2010-06-01  3:07 ` sgk at troutmask dot apl dot washington dot edu
2010-06-01  3:47 ` jvdelisle at verizon dot net
2010-06-01  4:31 ` pault at gcc dot gnu dot org
2010-06-01  8:03 ` burnus at gcc dot gnu dot org
2010-06-01 14:09 ` mikael at gcc dot gnu dot org
2010-06-01 14:14 ` mikael at gcc dot gnu dot org
2010-06-01 21:03 ` dfranke at gcc dot gnu dot org
2010-06-07 18:11 ` [Bug fortran/44354] implied do loop with its own variable name as upper bound tkoenig at gcc dot gnu dot org
2010-07-28 20:54 ` mikael 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=20100531215428.12254.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).