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 18:34:00 -0000	[thread overview]
Message-ID: <20100531183349.17661.qmail@sourceware.org> (raw)
In-Reply-To: <bug-44354-19262@http.gcc.gnu.org/bugzilla/>



------- Comment #4 from kargl at gcc dot gnu dot org  2010-05-31 18:33 -------
(In reply to comment #2)
> > Note that fortran is case insensitive,  ...
> 
> Indeed, but I think the implied do loop should still go from 1 to 5. Note that
> if I print 'i' after the loop I get 5.
> 

Of course it prints 5.  The 'i' in the do-loop has the scope of
the implied-do-loop.  The 'I' in the program has the scope of the
program.

laptop:kargl[247] cat ui.f90
      integer j(4)
      I=5
      j = 42
      j = (/(i,i=1,I-1)/)
      print '(A,I0,A,4(I0,1X))', 'I = ', I, ' j = ', j
      end

laptop:kargl[248] gfc4x -o z -fdump-tree-original ui.f90
laptop:kargl[249] ./z
I = 5 j = 0 134516008 0 0

The question becomes whether the 'I' in the implied-do-loop is
being used uninitialized.


-- 


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


  parent reply	other threads:[~2010-05-31 18:34 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 [this message]
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
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=20100531183349.17661.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).