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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
            Summary|[4.6 Regression] 465.tonto  |[4.6 Regression] wrong
                   |test run miscompares (even  |results with MATHMUL(...,
                   |with -O0)                   |TRANSPOSE (func ())) --
                   |                            |465.tonto test run
                   |                            |miscompares

--- Comment #16 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-12-09 
22:50:08 UTC ---
Thanks to Sebastian for some debugging help.

Reduced test case below.

Older gfortrans and other compilers produce (correct):
   4.0000000       4.0000000       6.0000000       6.0000000
The current 4.6 gfortran produces (wrong):
   3.0000000       3.0000000       7.0000000       7.0000000


implicit none
call sub()
contains
   subroutine sub()
      real, dimension(2,2) :: b
      b = 1.0
      b = matmul(b,transpose(func()))
      print *, b
   end subroutine

   function func() result(res)
      real, dimension(2,2) :: res
      res = reshape([1,2,3,4], [2,2])
   end function
end

Reply via email to