public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "fengwang at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/22290] New: Optimize Assigned GOTO to cause error with -O1 or higher
Date: Mon, 04 Jul 2005 08:23:00 -0000	[thread overview]
Message-ID: <20050704082324.22290.fengwang@gcc.gnu.org> (raw)

See a fortran program:
$ cat t.f
      integer nz
      assign 93 to nz
      go to nz,(93)
  93  continue
      end
$ gfortran -v
Target: ia64-unknown-linux-gnu
Configured with: ../gcc/configure --enable-languages=c,f95 --
prefix=/home/wf/loc
al
Thread model: posix
gcc version 4.1.0 20050704 (experimental)
$ gfortran -O0 -w t.f
$ ./a.out
That's correct.

But if we compile with -O1 or higher, we get 
$ ./a.out
Fortran runtime error: Assigned label is not in the list

We dump the original tree with -fdump-tree-original as follows:
MAIN__ ()
{
  int4 nz;
  void * nz.1;
  int4 nz.0 = -2;

  nz.0 = -1;
  nz.1 = &__label_000093;
  if (__builtin_expect (nz.0 != -1, 0))
    {
      _gfortran_runtime_error ("Assigned label is not a target 
label", "kgfm2.f"
, 5);
    }
  else
    {
      (void) 0;
    }
  if (&__label_000093 == nz.1) goto __label_000093; else (void) 0;
  _gfortran_runtime_error ("Assigned label is not in the list", "kgfm2.f", 5);
  __label_000093:;
}
That's correct.

I think this is tree-optimization error. Tested on ia64/i686-pc-linux.

-- 
           Summary: Optimize Assigned GOTO to cause error with -O1 or higher
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fengwang at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686/ia64-pc-linux


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


             reply	other threads:[~2005-07-04  8:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-04  8:23 fengwang at gcc dot gnu dot org [this message]
2005-07-04 10:00 ` [Bug fortran/22290] " pinskia at gcc dot gnu dot org
2005-07-04 12:38 ` fengwang at gcc dot gnu dot org
2005-07-04 15:28 ` steven at gcc dot gnu dot org
2005-07-05  8:39 ` fengwang at gcc dot gnu dot org
2005-07-05  8:44 ` fengwang at gcc dot gnu dot org
2005-07-06  7:42 ` fengwang at gcc dot gnu dot org
2005-07-07 22:16 ` tkoenig at gcc dot gnu dot org
2005-09-13 10:27 ` steven at gcc dot gnu dot org
2005-09-13 14:53 ` fengwang 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=20050704082324.22290.fengwang@gcc.gnu.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).