[Bug fortran/22495] New: Different ideas about .true. and .false.
tkoenig at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri Jul 15 08:52:00 GMT 2005
$ cat logic.f90
program main
implicit none
logical(kind=4) :: lo1, lo2
integer(kind=4) :: in, i
equivalence(lo1, in)
do i=0,4
in = i
call settrue(lo2)
print *,i, lo1 , lo1 .eqv. lo2, lo1 .eqv. .true.
end do
end program main
subroutine settrue(lo)
logical(kind=4) :: lo
lo = .true.
end subroutine
$ gfortran --std=f95 logic.f90
$ ./a.out
0 F F F
1 T T T
2 T F T
3 T F T
4 T F T
$ gfortran -v
Using built-in specs.
Target: ia64-unknown-linux-gnu
Configured with: ../gcc-4.1-20050709/configure --prefix=/home/zfkts --enable-
languages=c,f95
Thread model: posix
gcc version 4.1.0 20050709 (experimental)
The first .eqv. is translated into a check for equality
{
logical4 D.573;
D.573 = equiv.0.lo1 == lo2;
_gfortran_transfer_logical (&D.573, 4);
}
the second one is removed.
Do we care? Equivalencing integer and logical is prohibited
(although we don't warn about this with --std=f95; maybe
that is the error).
--
Summary: Different ideas about .true. and .false.
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tkoenig at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22495
More information about the Gcc-bugs
mailing list