From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 8FF21385AC25 for ; Fri, 30 Jul 2021 16:19:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8FF21385AC25 Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-179-lr44cZACMWOyRqYXiU-W1Q-1; Fri, 30 Jul 2021 12:19:39 -0400 X-MC-Unique: lr44cZACMWOyRqYXiU-W1Q-1 Received: by mail-lf1-f71.google.com with SMTP id c3-20020a0565123243b0290379403f4d35so4247293lfr.12 for ; Fri, 30 Jul 2021 09:19:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WaWCHjtnBA7qQGVNywoXqnt5x1xF0pQoeJFv4ojjo8A=; b=e4OF/oNI0FTCpnUbP/+lM7fyW9K0AtGo1MHJL26pi+YFisz9GhFcPhmcFlau0IghrQ my8mXJiITqT+IFlT2eOok+jggNhWH/5Z3PPLYiHtvlof/OTToyBTCQkbEtBJXvKMEYOp 86zF0GNoyvpn49iSkf+2kC5MbCnpHgADrfLaehTcHZs5qGWCsCN6jiwKNLKC+CS7xFyQ 2WnRWPB+4ScLNRWPySoyZD2u9S13w0z81RG8M0i/GMulIdbNxs3AgQTmsp1Tr1sptBRR 2o3jaLBn+Wgb5WAL1Ol1XeeRRIqXVKrFhsIUgCDYWVxYyPsXWOCac/71I29hnpxHsJPA R1JQ== X-Gm-Message-State: AOAM530DNe3hoLvGk7TBDlNllulD6D1nKCts2alVFGRxjxqAYuoYLXbQ BYcBYMPAbquU+8S90ZKNsb6PuUk7E6862TE4+WdHGfqxOPg+qh5pzVi4a6GTu0AH/Eo5p79giZf TF2KDGeq5tCYWfeZuLv/tvkUlM2efxdYIqIEi X-Received: by 2002:a2e:9d43:: with SMTP id y3mr2183363ljj.85.1627661976594; Fri, 30 Jul 2021 09:19:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQSMdsR5fUHO2cLEif7our4bZ/Na0YXN35eizxOjN9THx4TA1sQzOM7RLZEMnF2Iqg8hoiklc9VoijE/8+gMw= X-Received: by 2002:a2e:9d43:: with SMTP id y3mr2183169ljj.85.1627661971897; Fri, 30 Jul 2021 09:19:31 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Aldy Hernandez Date: Fri, 30 Jul 2021 18:19:21 +0200 Message-ID: Subject: Re: Failures building glibc with mainline GCC To: Joseph Myers Cc: libc-alpha@sourceware.org, GCC Mailing List , "MacLeod, Andrew" , Martin Sebor X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_ASCII_DIVIDERS, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jul 2021 16:19:44 -0000 There's a new jump threader in GCC which is much more aggressive, and may trigger latent problems with other warning passes, especially -Warray-bounds, -Woverflow, and -Wuninitialized. Do your problems go away if you take out commit 2e96b5f14e? I have notes throughout the commit analyzing variants of the above warnings (for example my addendum to gcc.c-torture/compile/pr83510.c). So far, all the warnings I've seen are legitimate jump threading opportunities that we are now doing, but which throw off the warning passes. Before the inclusion of the new threader, I had warned that this could happen. Perhaps we'll have to come up a way to reduce the false positives. Aldy On Fri, Jul 30, 2021 at 5:31 PM Joseph Myers wrote: > > There are a lot of failures building glibc with mainline GCC right now > > (previously, there were ICEs building glibc on various architectures, so > these might be hard to bisect): > > > * x86_64-linux-gnu: "error: array subscript 0 is outside array bounds of > '__seg_fs struct pthread * __seg_fs[0]' [-Werror=array-bounds]". This is > the one discussed in > . > > In file included from ../sysdeps/generic/libc-tsd.h:44, > from ../include/../locale/localeinfo.h:224, > from ../include/ctype.h:26, > from loadmsgcat.c:29: > loadmsgcat.c: In function '_nl_load_domain': > ../sysdeps/x86_64/nptl/tls.h:185:4: error: array subscript 0 is outside array bounds of '__seg_fs struct pthread * __seg_fs[0]' [-Werror=array-bounds] > 185 | (*(struct pthread *__seg_fs *) offsetof (struct pthread, header.self)) > | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ../sysdeps/nptl/libc-lock.h:92:18: note: in expansion of macro 'THREAD_SELF' > 92 | void *self = THREAD_SELF; \ > | ^~~~~~~~~~~ > loadmsgcat.c:770:3: note: in expansion of macro '__libc_lock_lock_recursive' > 770 | __libc_lock_lock_recursive (lock); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~ > > > * i686-gnu: > > hurdselect.c: In function '_hurd_select': > hurdselect.c:555:7: error: 'ss' may be used uninitialized in this function [-Werror=maybe-uninitialized] > 555 | _hurd_sigstate_unlock (ss); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~ > > As far as I can tell, this is a false positive from the compiler (this > code is only reached if (sigport != MACH_PORT_NULL), in which case ss has > been initialized). > > > * Several architectures (all of them 32-bit), powerpc-linux-gnu for > example: > > In file included from t.61.c:437: > In function 'from_t_61_single', > inlined from 'gconv' at ../iconv/skeleton.c:568:15: > ../iconv/loop.c:440:22: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=] > 440 | bytebuf[inlen++] = *inptr++; > | ~~~~~~~~~~~~~~~~~^~~~~~~~~~ > ../iconv/loop.c: In function 'gconv': > ../iconv/loop.c:382:17: note: at offset 2 into destination object 'bytebuf' of size 2 > 382 | unsigned char bytebuf[MAX_NEEDED_INPUT]; > | ^~~~~~~ > > I don't know if this is a false positive or not. > > > * powerpc64-linux-gnu: > > In file included from ../sysdeps/powerpc/dl-tls.c:20: > In function '_dl_allocate_tls_init', > inlined from '_dl_allocate_tls' at ../elf/dl-tls.c:621:10: > ../elf/dl-tls.c:529:10: error: array subscript -1 is outside array bounds of 'void[9223372036854775807]' [-Werror=array-bounds] > 529 | dtv_t *dtv = GET_DTV (result); > | ^~~ > In file included from ../elf/dl-tls.c:28, > from ../sysdeps/powerpc/dl-tls.c:20: > ../sysdeps/powerpc/nptl/tls.h:136:34: error: array subscript -1 is outside array bounds of 'void[9223372036854775807]' [-Werror=array-bounds] > 136 | ((tcbhead_t *) (tcbp))[-1].dtv = dtvp + 1 > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~ > ../elf/dl-tls.c:544:7: note: in expansion of macro 'INSTALL_DTV' > 544 | INSTALL_DTV (result, &dtv[-1]); > | ^~~~~~~~~~~ > > > * powerpc64le-linux-gnu: "error: '-mabi=ibmlongdouble' requires > '-mlong-double-128'". See > . > > > -- > Joseph S. Myers > joseph@codesourcery.com >