This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/22290] New: Optimize Assigned GOTO to cause error with -O1 or higher
- From: "fengwang at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Jul 2005 08:23:31 -0000
- Subject: [Bug tree-optimization/22290] New: Optimize Assigned GOTO to cause error with -O1 or higher
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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