Roberto Bagnara wrote:
Andrew Haley wrote:
Roberto Bagnara writes:
>
> Reading the thread "Autoconf manual's coverage of signed integer
> overflow & portability" I was horrified to discover about GCC's
> miscompilation of the remainder expression that causes INT_MIN % -1
> to cause a SIGFPE on CPUs of the i386 family. Are there plans to
> fix this bug (which, to me, looks quite serious)?
No, there aren't. It would make more sense for you to wrap % in some
code that checks for this, rather than for us to slow down every division
for this one special case.
With all due respect, I must say I am shocked. I always thought
(and taught) that we, Free Software people, value standard conformance
and getting things right. Now we have a bug that can shut down
airplanes
Please do not indulge in excessive rhetoric, planes do not get
shut down by compiler bugs. If you really think that the integrity
of avionics software depends on bug free compilers you have no
idea what you are talking about (I would guess you are for
example unfamiliar with DO-178B certification).
Yes, it's a bug, is it a serious bug, no? Will real software
be affected? no. Indeed I find any program that actually
does this remainder operation in practice to be highly
suspect.
A final remark: I think that today the problem is safety, not speed.
I don't think doing the right thing for remainder expression will
have such a high cost with the help of the optimizer and, maybe,
assistance from the kernel. But even if the cost turns out to be high,
the actual state of things is unacceptable: mentioning the bug prominently
in the documentation, trying to change the standard, ..., whatever;
but not leaving things as they are.
Yes, it should probably be fixed, but making a major fuss about
it seems peculiar at best. I think it is perfectly reasonable
for you to propose a patch to fix this if you are specially
concerned, but don't expect the community to rush to fix this
particular bug at high priority in response to this complaint.
There are lots of known bugs far more important than this one.