I was in the midst of preparing to commit the new versions of the array
TRANSFER testcases, when the bigendian test started giving troubles with
optimization greater than 0. This:

! { dg-do run }
! { dg-options "-O1" }

! Bigendian test posted by Perseus in comp.lang.fortran on 4 July 2005.
   integer(1), parameter :: zero = 0
   LOGICAL, PARAMETER :: bigend = IACHAR(TRANSFER(1,"a")) == zero
   LOGICAL :: bigendian
   call foo ()
contains
   subroutine foo ()
   integer :: chr, ans
   if (bigend) then
     ans = 1
   else
     ans = 0
   end if
   chr = IACHAR(TRANSFER(1,"a"))
   bigendian =  chr == 0_4
   if (bigendian) then
     ans = 1
   else
     ans = 0
   end if
   end subroutine foo
end

gives:

[EMAIL PROTECTED] transfer]# /svn-4.2/bin/gfortran -O1  -fdump-tree-original
big*.f90
bigendian.f90: In function ‘MAIN__’:
bigendian.f90:7: error: invalid operand to unary operator
&C.903;

bigendian.f90:7: error: invalid operand to unary operator
&C.904;

bigendian.f90:7: internal compiler error: verify_stmts failed

This ultimately comes about because the test for the casting of the integer
argument into char[0:] fails in is_gimple_val.


-- 
           Summary: Scalar TRANSFER - error: invalid operand to unary
                    operator
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pault at gcc dot gnu dot org


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

Reply via email to