during compile, received the following output
bug.f: In function 'master.0.mnthweek':
bug.f:82: error: invalid operand to binary operator
__result_master.0.mnthweekD.911

bug.f:82: internal compiler error: verify_stmts failed
Please submit a full bug report,
with preprocessed source if appropriate.


Gfortran version
Using built-in specs.
Target: powerpc-apple-darwin8
Configured with: ../gcc/configure --prefix=/usr/local/gfortran
--enable-languages=c,fortran --with-gmp=/tmp/gfortran-20060713/gfortran_libs
--enable-bootstrap --build=powerpc-apple-darwin8 --host=powerpc-apple-darwin8
--target=powerpc-apple-darwin8 : (reconfigured) ../gcc/configure
--prefix=/usr/local/gfortran --enable-languages=c,fortran
--with-gmp=/tmp/gfortran-20060713/gfortran_libs --enable-bootstrap
--build=powerpc-apple-darwin8 --host=powerpc-apple-darwin8
--target=powerpc-apple-darwin8 --disable-multilib
Thread model: posix
gcc version 4.2.0 20060713 (experimental)

The same code compiles with
gcc version 4.1.0 20060304 (Red Hat 4.1.0-3)



Compile command:
gfortran -fno-backslash -implicit-none -O3 -m32 -c bug.f

code:
c===================================================================
      integer function mnthweek(month, event)
        integer month
        character*(*) event
c       convert monthly values to a week based on the event
c  Events 'GRAZ', 'TREM', 'FIRE', 'HARV' and 'THRV' occur after plant 

        integer MONTHS
        parameter (MONTHS = 12)

        integer wtomonth, wkprmn, winmonth, m


        integer frstwk(MONTHS), lastwk(MONTHS)
        data frstwk /1,  5,  9, 14, 18, 22, 27, 31, 35, 40, 44, 48/
        data lastwk /4,  8, 13, 17, 21, 26, 30, 34, 39, 43, 47, 52/


c       Make sure that we are asking about a valid month
        m = mod(month-1,12)+1

c       by default assume the event will occur on the first week

c       The special case of every week in the month
        mnthweek = frstwk(m)
        if(event .eq. 'IRRI' .or. event .eq. 'GRAZ') then
          mnthweek = (lastwk(m)-frstwk(m))*1000 + mnthweek


c       the following events occur after growth in Century 4. Place these
c       events in the last week

c       removal and harvest
        else if (event .eq. 'TREM' .or. event .eq. 'FIRE' .or.
     &      event .eq. 'HARV' .or.  event .eq. 'THRV') then
          mnthweek = lastwk(m)
        endif

        write(*,*) mnthweek,' = mnthweek(',month, event,')'
      return

c     convert the week number to month
      entry wtomonth(month)
         wtomonth = mod(int(mod(month+43,52)*3./13.)+2,12)+1
      return
      end
c===================================================================


NOTE:
code compiles if the write
        write(*,*) mnthweek,' = mnthweek(',month, event,')'
or the entry block is removed.

I did not try a newer build.


-- 
           Summary: internal compiler error: verify_stmts failed
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kendrick dot killian at colostate dot edu


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

Reply via email to