gcc 8 miscompiles scipy/optimize/minpack/qrsolv.f
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc |
Fix Released
|
Medium
|
|||
gcc-8 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
imexam (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
python-scipy (Debian) |
Fix Released
|
Unknown
|
|||
python-scipy (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Originally reported in https:/
The following simple test fails on s390x:
-------
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]))
-------
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:/
The bug seems to be a miscompilation of scipy/optimize/
with -funroll-loops. Removing -funroll-loops is enough to get the
leastsq testcase to pass.
Changed in python-scipy (Debian): | |
status: | Unknown → New |
Changed in gcc: | |
importance: | Unknown → Medium |
status: | Unknown → New |
Changed in gcc: | |
status: | New → Incomplete |
Changed in gcc: | |
status: | Incomplete → In Progress |
Changed in gcc: | |
status: | In Progress → Fix Released |
Changed in python-scipy (Debian): | |
status: | New → Fix Released |
Changed in gcc-8 (Ubuntu): | |
status: | New → Fix Released |
Changed in imexam (Ubuntu): | |
status: | New → Invalid |
Changed in python-scipy (Ubuntu): | |
status: | New → Invalid |
seen when build scipy on s390x with the current GCC 8 branch. According to the Debian report [1] this is tracked down to miscompilation of one Fortran file with -funroll-loops. The Ubuntu report [2] has a "standalone" python test case.
[1] https:/ /bugs.debian. org/cgi- bin/bugreport. cgi?bug= 915738 /bugs.launchpad .net/ubuntu/ +source/ python- scipy/+ bug/1811798
[2] https:/