On 3/13/19 11:35 AM, Bruno Haible wrote: > A simpler fix would have been to mark the 'minus_zero' variable as 'static':
Yes, that would have been a smaller change. Although I originally did that, there's a reason I went for the larger change. Making the variable 'static' might cause some compilers to notice that the variable never changes, so it's a constant, so it can be folded, and then they (mistakenly) convert -0.0 to 0.0. Originally the variable was extern and the extern hack prevents most compilers from doing this incorrect optimization (unless they're doing whole-program optimization, which typically they aren't). Since making the variable static removed the hack, I decided it was clearer to use the larger change, which makes it more obvious that we aren't trying to work around this potential problem any more. I hope the issue I mentioned is not a real problem. If it is, we can go back to the old code except rename the variable so that it's called "lminus_zero" for the long double case. I considered doing that too, but that's even more confusing and I hope we don't have to be that confusing.