Masamichi Hosoda <truer...@trueroad.jp> writes: >>>> We currently have the problem that the compiler used in GUB for >>>> compiling 32bit binaries gets an internal compiler fault for those >>>> options. >>>> >>>> We'll need to figure out whether a newer compiler does the trick, and if >>>> it does, update GUB. Or find a different way of proceeding. >>>> >>>> I'll see whether I can convince my current compilers to generate 32bit >>>> code and see whether those are currently up to using those options. If >>>> current compilers don't want them, we'll need to revert to a different >>>> plan. >>> >>> It seems that static cast from `unsigned long long` to `double` >>> by x86 SSE2 raises the internal compile error. >>> However, static cast from `signed long long` to `double` >>> does not raise the errir. >>> I think it can be a workaround for rational.cc. >>> >>> i.e. >>> First, static cast from `unsigned long long` to `signed long long` >>> Then, static cast from `singed long long` to `double` >> >> Oh wow. I would never have thought one could identify something as >> specific. I think I have convinced my system to build a 32bit Guile, >> but have problems convincing LilyPond to do the same. So I cannot help >> with debugging this situation yet or even finding out whether it >> persists into newer compiler versions. > > I've attached the workaround patch for stable/2.20 branch. > The results of my experiment is here.
>>From 2a3816e49067e026c7180dc6a3b2d5614d9c20d6 Mon Sep 17 00:00:00 2001 > From: Masamichi Hosoda <truer...@trueroad.jp> > Date: Tue, 4 Feb 2020 23:30:29 +0900 > Subject: [PATCH] Add workaround for avoiding GUB darwin-x86 error > > In GUB, g++ 4.9.4 for darwin-x86 (macOS x86), > it seems that static cast from `unsigned long long` to `double` > by x86 SSE2 raises an internal compile error. > However, static cast from `signed long long` to `double` > does not raise the error. > So we use it for a workaround. > > i.e. > First, static cast from `unsigned long long` to `signed long long`. > Then, static cast from `singed long long` to `double`. > --- > flower/rational.cc | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/flower/rational.cc b/flower/rational.cc > index 559e1646a0..9435edbb8f 100644 > --- a/flower/rational.cc > +++ b/flower/rational.cc > @@ -31,7 +31,23 @@ double > Rational::to_double () const > { > if (sign_ == -1 || sign_ == 1 || sign_ == 0) > +// FIXME: workaround: In GUB, g++ 4.9.4 for darwin-x86, > +// it seems that static cast from `unsigned long long` to `double` > +// by x86 SSE2 raises an internal compile error. > +// However, static cast from `signed long long` to `double` > +// does not raise the error. > +// So we use it for a workaround. > +#if defined (__i386__) && defined (__APPLE__) && \ > + defined (__SSE2_MATH__) && __GNUC__ < 5 Wouldn't the same problem occur on Windows? We have 32bit executables there as well. Or is the compiler version we use there not afflicted? -- David Kastrup