FS#68071 - [gcc] backport for an important GCC 10 miscompilation regression
Attached to Project:
Arch Linux
Opened by ux (ubitux) - Friday, 02 October 2020, 07:32 GMT
Last edited by Antonio Rojas (arojas) - Wednesday, 27 October 2021, 11:16 GMT
Opened by ux (ubitux) - Friday, 02 October 2020, 07:32 GMT
Last edited by Antonio Rojas (arojas) - Wednesday, 27 October 2021, 11:16 GMT
|
Details
Since version 10 is packaged, GCC is mis-compiling code in
various memcmp situations:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95189
Basically, the following will return the opposite of the expected result: char a[] = "\0abc"; return __builtin_memcmp (a, "\0\0\0\0", 4); (builtin memcmp is sometimes automatically used by gcc when calling memcmp()) The bug has been reported (and fixed upstream) for months, but there is still no backport. The issue is pretty bad as it affects a number of packages; see http://r6.ca/blog/20200929T023701Z.html for more info. The author made patch to detect the mis-compilation, which might be of interest to evaluate the impact on Archlinux packages. On his system only, he detected the issue in the kernel, in a crypto lib used in bitcoin, in codecs, ... Nevertheless, GCC maintainers don't look reactive given the importance of this bug. I'm also not confident at all having all my packages built with this GCC as I expected this specific issue in a small personal project. |
This task depends upon
Comment by ux (ubitux) - Friday, 02
October 2020, 07:42 GMT
Comment by Evgeniy (evgeniy) -
Tuesday, 13 April 2021, 21:48 GMT
Oups I'm sorry forgot to add "[gcc]" in the topic, and it seems I
can't edit it.
gcc 10.3 is out and contains that fix. Though there are no gcc
10.3 arch package yet.