-Waggressive-loop-optimizations errors building glibc tests (32-bit only)
Joseph Myers
joseph@codesourcery.com
Wed Oct 20 17:43:51 GMT 2021
My build-many-glibcs.py bot is showing new -Waggressive-loop-optimizations
errors building the glibc testsuite for 32-bit architectures with GCC
mainline:
In function 'dynarray_long_noscratch_resize',
inlined from 'test_long_overflow' at tst-dynarray.c:489:5,
inlined from 'do_test' at tst-dynarray.c:571:3:
../malloc/dynarray-skeleton.c:391:36: error: iteration 1073741823 invokes undefined behavior [-Werror=aggressive-loop-optimizations]
391 | DYNARRAY_ELEMENT_INIT (&list->u.dynarray_header.array[i]);
tst-dynarray.c:39:37: note: in definition of macro 'DYNARRAY_ELEMENT_INIT'
39 | #define DYNARRAY_ELEMENT_INIT(e) (*(e) = 23)
| ^
In file included from tst-dynarray.c:42:
../malloc/dynarray-skeleton.c:389:37: note: within this loop
389 | for (size_t i = old_size; i < size; ++i)
| ~~^~~~~~
In function 'dynarray_long_resize',
inlined from 'test_long_overflow' at tst-dynarray.c:479:5,
inlined from 'do_test' at tst-dynarray.c:571:3:
../malloc/dynarray-skeleton.c:391:36: error: iteration 1073741823 invokes undefined behavior [-Werror=aggressive-loop-optimizations]
391 | DYNARRAY_ELEMENT_INIT (&list->u.dynarray_header.array[i]);
tst-dynarray.c:27:37: note: in definition of macro 'DYNARRAY_ELEMENT_INIT'
27 | #define DYNARRAY_ELEMENT_INIT(e) (*(e) = 17)
| ^
In file included from tst-dynarray.c:28:
../malloc/dynarray-skeleton.c:389:37: note: within this loop
389 | for (size_t i = old_size; i < size; ++i)
| ~~^~~~~~
Preprocessed source for arm-linux-gnueabi attached; build with -O2 -Wall
-Werror. I don't know whether it's a GCC or glibc bug, but it seems
likely to have been introduced by a GCC change (in the range
4abc0c196b10251dc80d0743ba9e8ab3e56c61ed (exclusive) to
d8edfadfc7a9795b65177a50ce44fd348858e844 (inclusive) - those are the
commits of working and failing test runs) rather than a glibc change.
https://sourceware.org/pipermail/libc-testresults/2021q4/008740.html
--
Joseph S. Myers
joseph@codesourcery.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tst-dynarray.i.gz
Type: application/gzip
Size: 26873 bytes
Desc:
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20211020/2da857ac/attachment-0001.gz>
More information about the Gcc
mailing list