public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/22495] New: Different ideas about .true. and .false.
@ 2005-07-15  8:52 tkoenig at gcc dot gnu dot org
  2005-07-15 22:19 ` [Bug fortran/22495] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 15+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2005-07-15  8:52 UTC (permalink / raw)
  To: gcc-bugs

$ 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


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

end of thread, other threads:[~2006-01-30  6:44 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-22495-10391@http.gcc.gnu.org/bugzilla/>
2005-11-01 21:30 ` [Bug fortran/22495] Different ideas about .true. and .false tobi at gcc dot gnu dot org
2005-11-01 21:36 ` tobi at gcc dot gnu dot org
2005-11-02 12:37 ` tobi at gcc dot gnu dot org
2005-11-05 22:05 ` tkoenig at gcc dot gnu dot org
2005-11-05 23:06 ` tobi at gcc dot gnu dot org
2005-11-05 23:20 ` tkoenig at gcc dot gnu dot org
2005-11-06  0:02 ` kargl at gcc dot gnu dot org
2005-11-06  0:22 ` tobi at gcc dot gnu dot org
2005-11-06  0:23 ` tobi at gcc dot gnu dot org
2005-11-06  0:32 ` kargl at gcc dot gnu dot org
2005-11-06 15:01 ` tkoenig at gcc dot gnu dot org
2006-01-29 23:30 ` tkoenig at gcc dot gnu dot org
2006-01-30  0:52 ` kargl at gcc dot gnu dot org
2006-01-30  6:44 ` tkoenig at gcc dot gnu dot org
2005-07-15  8:52 [Bug fortran/22495] New: " tkoenig at gcc dot gnu dot org
2005-07-15 22:19 ` [Bug fortran/22495] " pinskia 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).