From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 4C4353858407 for ; Mon, 6 Sep 2021 14:49:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4C4353858407 Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 7969D200D6; Mon, 6 Sep 2021 14:49:11 +0000 (UTC) Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id 5F6C61398F; Mon, 6 Sep 2021 14:49:11 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id RkcXFmcqNmGgVgAAGKfGzw (envelope-from ); Mon, 06 Sep 2021 14:49:11 +0000 Subject: Re: Array out of bounds To: Simon Marchi , Jan-Benedict Glaw , gdb@sourceware.org References: <20210905064035.azigz657cpfjonoo@lug-owl.de> <20210905180613.ykl6f3lvsio46jdg@lug-owl.de> <6e5e153c-e540-63d5-4f5d-e1e700ee08d7@polymtl.ca> <8d535493-e77b-05da-d7b1-afb4379801f1@suse.de> From: Tom de Vries Message-ID: Date: Mon, 6 Sep 2021 16:49:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <8d535493-e77b-05da-d7b1-afb4379801f1@suse.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, 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: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2021 14:49:13 -0000 On 9/6/21 12:24 PM, Tom de Vries via Gdb wrote: > On 9/6/21 3:48 AM, Simon Marchi via Gdb wrote: >> >> >> On 2021-09-05 2:06 p.m., Jan-Benedict Glaw wrote: >>> Hi! >>> >>> On Sun, 2021-09-05 08:40:35 +0200, Jan-Benedict Glaw wrote: >>>> Hi! >>>> >>>> As I started with automated building/testing the GNU Toolchain again, >>>> I found this when building GDB (make all-gdb) with a fairly recent GCC >>>> on a Linux system (PC) when GDB is configured for >>>> --target=aarch64-linux: >>> >>> Just to add: Seems to be independent of a target. Produces the same >>> warning/error for all tested targets using a current GCC. >>> >>> Thanks, >>> Jan-Benedict >>> >> >> I just built gcc at 66bba4dc263d ("Daily bump."), and I don't see it. >> > > I've managed to reproduce, filed as PR gcc/102216 - "False positive > warray-bounds with -O2" @ > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102216 . FWIW, I've done a -Wno-array-bounds build at -O2 using the same gcc, and that build succeeded. Thanks, - Tom $ git diff diff --git a/gdb/configure b/gdb/configure index f0b1af4a6ea..410e69d09a1 100755 --- a/gdb/configure +++ b/gdb/configure @@ -16903,6 +16903,7 @@ build_warnings="-Wall -Wpointer-arith \ -Wmissing-declarations \ -Wmissing-prototypes \ -Wstrict-null-sentinel \ +-Wno-array-bounds \ " case "${host}" in diff --git a/gdbserver/configure b/gdbserver/configure index b227167e270..ca4b12adc76 100755 --- a/gdbserver/configure +++ b/gdbserver/configure @@ -9653,6 +9653,7 @@ build_warnings="-Wall -Wpointer-arith \ -Wmissing-declarations \ -Wmissing-prototypes \ -Wstrict-null-sentinel \ +-Wno-array-bounds \ " case "${host}" in diff --git a/gdbsupport/configure b/gdbsupport/configure index a9dd02c5b72..f39d1a794a2 100755 --- a/gdbsupport/configure +++ b/gdbsupport/configure @@ -10138,6 +10138,7 @@ build_warnings="-Wall -Wpointer-arith \ -Wmissing-declarations \ -Wmissing-prototypes \ -Wstrict-null-sentinel \ +-Wno-array-bounds \ " case "${host}" in diff --git a/gdbsupport/warning.m4 b/gdbsupport/warning.m4 index 46036fa461e..f68e9cf3778 100644 --- a/gdbsupport/warning.m4 +++ b/gdbsupport/warning.m4 @@ -53,6 +53,7 @@ build_warnings="-Wall -Wpointer-arith \ -Wmissing-declarations \ -Wmissing-prototypes \ -Wstrict-null-sentinel \ +-Wno-array-bounds \ " case "${host}" in