[Bug fortran/12633] New: logical expression gives incorrect result with -fugly-logint option

dwyatt at kohlmansystems dot com gcc-bugzilla@gcc.gnu.org
Thu Oct 16 07:06:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: logical expression gives incorrect result with -fugly-
                    logint option
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dwyatt at kohlmansystems dot com
                CC: gcc-bugs at gcc dot gnu dot org

GNU Fortran (GCC) 3.3.1 (cygming special)

Compiled w/: g77 -fugly-logint -o cygt cyg_test.f - no errors,
./cygt Output:  Test 1: If is true -2
                Test 2: If is false 0

Compiled w/: g77 -o cygt cyg_test.f - no errors,
./cygt Output:  Test 1: If is false F
                Test 2: If is false F

Source of cyg_test.f:
        program cyg_test

        logical  vis550
        logical  wkstub

        wkstub = .true.
        vis550 = .false.
C
C       Note: These two if-then-else structures should produce the same
C       results. They should both be .false.
C
        if (.not. (vis550 .or. wkstub)) then
            write (*,*) "Test 1: If is true",
     +                  .not. (vis550 .or. wkstub)
        else
            write (*,*) "Test 1: If is false",
     +                  .not. (vis550 .or. wkstub)
        endif

        if (.not. vis550 .and. .not. wkstub) then
            write (*,*) "Test 2: If is true",
     +                  .not. vis550 .and. .not. wkstub
        else
            write (*,*) "Test 2: If is false",
     +                  .not. vis550 .and. .not. wkstub
        endif

        end



More information about the Gcc-bugs mailing list