This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/82004] [8 Regression] SPEC CPU2017 628.pop2_s miscompare


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82004

--- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
If glibc implements a faster exp10/exp10f, we could do what I've done for
PR84309 and expand pow (10, x) as exp10 (x) and pow (C, x) where C is pow (10,
N) for integral N as exp10 (log10 (C) * x).
Even if it doesn't, there is some chance that perhaps 628.pop2_s propagates a
constant into that x of pow (10, x), so in theory even just deferring the
folding to after vectorization like we do for C which is pow (2, N) for
integral N might help.

Looking at
http://oceans11.lanl.gov/trac/POP/browser/branches/ice_shelf_partial_cells/source/sw_absorption.F90?rev=373&order=name&desc=True
I think that actually is the case here.
>From that source (haven't looked at SPEC2k17) it seems it is essentially:
! PR middle-end/82004
! { dg-do run }
! { dg-options "-Ofast" }

  integer, parameter :: r8 = selected_real_kind(13), i4 = kind(1)
  integer (i4), parameter :: a = 400, b = 2
  real (r8), parameter, dimension(b) :: c = (/ .001_r8, 10.00_r8 /)
  real (r8) :: d, e, f, g, h, j

  d = c(1)
  e = c(b)
  f = (log10(e)-log10(d))/real(a)
  g = log10(d) - f
  h = 10**(g)
  j = 10
  j = j**(g)
  if (h.ne.j) stop 1
end

(with the j and j = 10; j = j**(g); if (h.ne.j) stop 1 added by me to make it
fail when miscompiled).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]