------- Comment #1 from sje at cup dot hp dot com  2007-06-07 22:47 -------
I have looked into this bug and I think it is an HP math lib bug.  The 64 bit
powf function is using %fr12R but not saving/restoring it the way it is
supposed to.  I have a query in to the math lib folks to see if they can verify
my finding.

Here is a smaller test case that prints different values at -O1 or -O2 than at
-O0.

program test
  real a
  call run_me (-1.1, -1)
  a = -1.1
end program test

subroutine run_me(a, i)
  implicit none

  real, intent(in) :: a
  integer, intent(in) :: i
  print *, a**-2.0
  print *, (1/a)*(1/a)
  call check_equal_r (a**-2.0, (1/a)*(1/a))
end subroutine run_me

subroutine check_equal_r (a, b)
  real, intent(in) :: a, b
  print *, a
  print *, b
end subroutine check_equal_r


-- 

sje at cup dot hp dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sje at cup dot hp dot com


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

Reply via email to