From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28987 invoked by alias); 6 Nov 2019 23:26:00 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 28886 invoked by uid 89); 6 Nov 2019 23:26:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=unavailable version=3.3.1 spammy= X-HELO: us-smtp-delivery-1.mimecast.com Received: from us-smtp-1.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (205.139.110.61) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 06 Nov 2019 23:25:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573082757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:openpgp:openpgp:autocrypt:autocrypt; bh=yrJKL+pxuaMuOE/HEDxRiXSfq2CIwhSXA+qI11ZTSxU=; b=FLyXc8VSyQ36EcKhkpBUmUZrjxdHINL43bxBq8SQpfbl2CVaFZR5FwY4KjM60ZcaD4nMmh zvHBBWNXbE+H7gSS+jIY9xyF7AZZFMTGcIxH1uOJV/qg40EGdAehzYxN27+oJPL/tN9pOl dGcdl546lNxlV/mBdHDGOb46+gX/yng= 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-34-fbDPomlcOX-Wegrb5kCUJg-1; Wed, 06 Nov 2019 18:25:53 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B1E61477; Wed, 6 Nov 2019 23:25:52 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-52.rdu2.redhat.com [10.10.112.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 61BC260870; Wed, 6 Nov 2019 23:25:51 +0000 (UTC) Subject: Re: [PATCH] bring -Warray-bounds closer to -Wstringop-overflow (PR91647, 91463, 91679) To: "Maciej W. Rozycki" , Martin Sebor , libc-alpha@sourceware.org Cc: gcc-patches References: <5573d108-2441-8d0f-6c60-514b4fd0db3e@gmail.com> From: Jeff Law Openpgp: preference=signencrypt Message-ID: <198f3ac9-3958-97c8-6c6f-1ce9bdbb1465@redhat.com> Date: Wed, 06 Nov 2019 23:26:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2019-11/txt/msg00451.txt.bz2 On 11/6/19 4:09 PM, Maciej W. Rozycki wrote: > On Fri, 1 Nov 2019, Martin Sebor wrote: >=20 >> Rebuilding the kernel with the updated patch results in the following >> breakdown of the two warnings (the numbers are total instances of each, >> unique instances, and files they come from): >> >> -Wzero-length-bounds 49 46 13 >> -Warray-bounds 45 14 8 >> >> The -Warray-bounds instances I checked look legitimate even though >> the code is some of them still looks benign. I'm not sure there's >> a good way to relax the warning to sanction some of these abuses >> without also missing some bugs. It might be worth looking into >> some more in stage 3, depending on the fallout during mass rebuild. >> >> After bootstrapping on x86_64 and i385 and regtesting I committed >> the attached patch in r277728. >=20 > It is what I believe has also broken glibc: >=20 > In file included from ../sysdeps/riscv/libc-tls.c:19: > ../csu/libc-tls.c: In function '__libc_setup_tls': > ../csu/libc-tls.c:209:30: error: array subscript 1 is outside the bounds = of an interior zero-length array 'struct dtv_slotinfo[0]' [-Werror=3Dzero-l= ength-bounds] > 209 | static_slotinfo.si.slotinfo[1].map =3D main_map; > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ > In file included from ../sysdeps/riscv/ldsodefs.h:46, > from ../sysdeps/gnu/ldsodefs.h:46, > from ../sysdeps/unix/sysv/linux/ldsodefs.h:25, > from ../sysdeps/unix/sysv/linux/riscv/ldsodefs.h:22, > from ../csu/libc-tls.c:21, > from ../sysdeps/riscv/libc-tls.c:19: > ../sysdeps/generic/ldsodefs.h:423:7: note: while referencing 'slotinfo' > 423 | } slotinfo[0]; > | ^~~~~~~~ > cc1: all warnings being treated as errors >=20 > (here in a RISC-V build). >=20 > Has anybody looked yet into how the breakage could possibly be addressed? Yea, Florian posted patches over the weekend to fix glibc. They're still going through the review/update cycle. jeff