public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/22290] New: Optimize Assigned GOTO to cause error with -O1 or higher
@ 2005-07-04  8:23 fengwang at gcc dot gnu dot org
  2005-07-04 10:00 ` [Bug fortran/22290] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 13+ messages in thread
From: fengwang at gcc dot gnu dot org @ 2005-07-04  8:23 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2005-10-25 15:02 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-22290-10258@http.gcc.gnu.org/bugzilla/>
2005-10-25 13:44 ` [Bug fortran/22290] Optimize Assigned GOTO to cause error with -O1 or higher cvs-commit at gcc dot gnu dot org
2005-10-25 14:06 ` cvs-commit at gcc dot gnu dot org
2005-10-25 14:09 ` fengwang at gcc dot gnu dot org
2005-10-25 15:02 ` pinskia at gcc dot gnu dot org
2005-07-04  8:23 [Bug tree-optimization/22290] New: " fengwang at gcc dot gnu dot org
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

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).