public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* -Waggressive-loop-optimizations errors building glibc tests (32-bit only)
@ 2021-10-20 17:43 Joseph Myers
  0 siblings, 0 replies; only message in thread
From: Joseph Myers @ 2021-10-20 17:43 UTC (permalink / raw)
  To: libc-alpha, gcc

[-- Attachment #1: Type: text/plain, Size: 2180 bytes --]

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

[-- Attachment #2: Type: application/gzip, Size: 26873 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-20 17:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-20 17:43 -Waggressive-loop-optimizations errors building glibc tests (32-bit only) Joseph Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).