egcs-2.92.02 19980905 (m68k-next-nextstep3): Address of hoisted loadclobbered

Toon Moene
Tue Sep 8 13:05:00 GMT 1998

Compile the following with flags:

/usr/snp/bin/g77 -g -O3 -funroll-loops -fforce-addr  
-fomit-frame-pointer -S -funix-intrinsics-hide a.f

      subroutine MXVA( A, IA, JA, X, INCX, Y, INCY, M, N )
      implicit none
      integer  i, j, ia, ja, incx, incy, m, n
      double precision   a(*), x(*), y(*)
      if ( m    .le. 0 .or.
     ,     n    .le. 0 .or.
     ,     ia   .eq. 0 .or.
     ,     ja   .eq. 0 .or.
     ,     incx .eq. 0 .or.
     ,     incy .eq. 0     ) then
         write(0,*)'MXVA - ARGUMENT ERROR; ABORT'
         call abort
      do i = 1, m
         y((i-1)*incy+1) = 0.0
         do j = 1, n
            y((i-1)*incy+1) = y((i-1)*incy+1) +
     +         a((i-1)*ia+(j-1)*ja+1) * x((j-1)*incx+1)

An excerpt from the assmebly output, around the unrolled inner loop:

        fmoved a4@,fp1		<-- Load hoisted
        movel d4,d0
        movel sp@(60),a4	<-- Bleeeccchhhh
        mulsl a4@,d0
        fmoved fp1,a4@		<-- Store sunk

which, of course, results in a Segmentation Violation.

Hope this is complete enough,

More information about the Gcc mailing list