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 [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id A11DE3953424 for ; Fri, 30 Jul 2021 17:02:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A11DE3953424 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-538-KLf3Wfk2MrmFwvw-gaFacg-1; Fri, 30 Jul 2021 13:02:07 -0400 X-MC-Unique: KLf3Wfk2MrmFwvw-gaFacg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AD39793923; Fri, 30 Jul 2021 17:02:06 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.194.62]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3C6AA5F707; Fri, 30 Jul 2021 17:02:06 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 16UH24UO454197 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 30 Jul 2021 19:02:04 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 16UH24EC454196; Fri, 30 Jul 2021 19:02:04 +0200 Date: Fri, 30 Jul 2021 19:02:04 +0200 From: Jakub Jelinek To: Martin Sebor Cc: Joseph Myers , libc-alpha@sourceware.org, gcc@gcc.gnu.org Subject: Re: Failures building glibc with mainline GCC Message-ID: <20210730170204.GP2380545@tucnak> Reply-To: Jakub Jelinek References: <1bcf4c26-1619-06fa-fd8d-4e944ac6f07a@gmail.com> MIME-Version: 1.0 In-Reply-To: <1bcf4c26-1619-06fa-fd8d-4e944ac6f07a@gmail.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=unavailable autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jul 2021 17:02:12 -0000 On Fri, Jul 30, 2021 at 10:53:28AM -0600, Martin Sebor via Gcc wrote: > On 7/30/21 9:30 AM, 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 > > . > > I submitted a patch for this warning to Glibc: > https://sourceware.org/pipermail/libc-alpha/2021-July/128829.html > which is what ultimately precipitated Florian's question. If null > pointers to named address spaces are valid I'll adjust GCC to > avoid the warning for now (as has been discussed, for GCC 12 I'd > like to redo the logic to detect the problematic null pointer > arithmetic instead). They are valid for some address spaces. See e.g. how gimple.c (check_loadstore) used by infer_nonnull_range_by_dereference uses a target hook for that: /* Some address spaces may legitimately dereference zero. */ addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (op)); if (targetm.addr_space.zero_address_valid (as)) return false; Jakub