[Bug 1811798]

Jakub-gcc 1811798 at bugs.launchpad.net
Mon Feb 4 13:07:52 UTC 2019


(In reply to Andreas Krebbel from comment #14)
> (In reply to Jakub Jelinek from comment #11)
> > ... Can't what you are doing in the splitters be done in
> > define_peephole2 instead?
> 
> Not that easy unfortunately.  peephole2 will run after reload. So the FP
> constant ok 0.0 will already be reloaded into a register first or pushed
> into literal pool. The point of doing the transformation is to avoid this.

But it is still invalid.  If those splitters are essentially to you and
worth slowing the compiler on s390*, then you could e.g. add a custom
target pass right before split1, where you'd just df_note_addr_problem
(); df_analyze (); and thus ensured that during the splitting you could
use the REG_DEAD/REG_UNUSED notes safely.  In the splitters you'd likely
need to use current_pass to verify you are in the pass for which you've
done this.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-8 in Ubuntu.
https://bugs.launchpad.net/bugs/1811798

Title:
  gcc 8 miscompiles scipy/optimize/minpack/qrsolv.f

Status in gcc:
  In Progress
Status in gcc-8 package in Ubuntu:
  New
Status in imexam package in Ubuntu:
  New
Status in python-scipy package in Ubuntu:
  New
Status in python-scipy package in Debian:
  New

Bug description:
  Originally reported in https://bugs.debian.org/906198

  The following simple test fails on s390x:

  ---------------------------8<------------------------------
  import numpy as np
  from scipy.optimize import leastsq

  y = np.array([0., 1., 1., 2., 1., 1., 0.])
  x = np.arange(len(y))

  def func(par):
      return par[2] * np.exp(-(x - par[0])**2/par[1]) - y

  print(leastsq(func, [0,1,0]))
  ---------------------------8<------------------------------

  The expected result is

  (array([3.        , 4.42280548, 1.67210345]), 1)

  while on S390x, one gets

  (array([0.        , 1.        , 0.34027645]), 3)

  
  Further information from https://bugs.debian.org/915738

  The bug seems to be a miscompilation of scipy/optimize/minpack/qrsolv.f
  with -funroll-loops. Removing -funroll-loops is enough to get the
  leastsq testcase to pass.

To manage notifications about this bug go to:
https://bugs.launchpad.net/gcc/+bug/1811798/+subscriptions



More information about the foundations-bugs mailing list