The following program gives wrong answers when an array
is used in an array constructor as an argument to IEOR.

Dick Hendrickson

      program try_fa6077

! fails on Windows XP
! gcc version 4.4.0 20080312 (experimental) [trunk revision 133139]

      call       fa6077 (  10,  1, -1, (/1,2,3,4,5,6,7,8,9,10/))
      end

      subroutine FA6077 (nf10,nf1,mf1, ida)
      INTEGER IDA1(10)
      INTEGER IDA2(10), ida(10)


      IDA1 = IEOR((/1,2,3,4,5,6,7,8,9,10/),
     $            (/(IDA(J1),J1=10,1,-1)/) )

      IDA2 = IEOR ((/1,2,3,4,5,6,7,8,9,10/), (/10,9,8,7,6,5,4,3,2,1/) )

      print '(10i3)', (/1,2,3,4,5,6,7,8,9,10/), 
     $                (/10,9,8,7,6,5,4,3,2,1/),ida1,ida2
      END SUBROUTINE
c:\gfortran:gfortran fa6077.f

c:\gfortran:a
  1  2  3  4  5  6  7  8  9 10
 10  9  8  7  6  5  4  3  2  1
  8 10  4  2  0  2  4 10  8 10
 11 11 11  3  3  3  3 11 11 11


-- 
           Summary: wrong answers with array constructor argument to IEOR
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dick dot hendrickson at gmail dot com


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

Reply via email to