OMG, -10==10 in linux! (with gcc prior to 20071117)
Alexander E. Patrakov
patrakov at gmail.com
Tue Nov 20 22:34:17 MST 2007
2007/11/21, Matthew Burgess <matthew at linuxfromscratch.org>:
> But see http://www.ussg.iu.edu/hypermail/linux/kernel/0711.2/1296.html - the kernel uses it's own abs macro, so GCC never sees the call to abs(). Therefore the kernel tarball isn't a suitable candidate to try finding instances of this bug in.
Correct, but it is still a good estimate of the number of instances
where the result of abs() (built-in or not) is multiplied by
something.
> I'd hazard a guess that something like mplayer or ffmpeg might be more suitable given the heavy use of maths in them...but it really is just a guess. So far, 3.3.x, 3.4.x, 4.1.x and 4.2.x are known to fail and we've not had a single instance of this bug reported. So, either there is very little/no code that triggers the bug, or its affects aren't noticeable in the apps that do trigger it. I'm not saying that the testsuites for LFS/BLFS packages provide 100% coverage (my experience in the field has taught me not to be so naive), but all my builds pass them with the exception of the known failures.
I will do a local build of the LiveCD with a patched gcc. The patch is
different from the official fix: I added a warning that fires if gcc
sees negative_const * abs(something). The intention is to grep through
the logs for this new warning and thus count all cases that the old
gcc has miscompiled on the old LiveCD.
--
Alexander E. Patrakov
More information about the lfs-dev
mailing list