From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from black.elm.relay.mailchannels.net (black.elm.relay.mailchannels.net [23.83.212.19]) by sourceware.org (Postfix) with ESMTPS id AC2FA38582BC for ; Wed, 11 Jan 2023 13:14:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AC2FA38582BC Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gotplt.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id DDB0D501879; Wed, 11 Jan 2023 13:14:47 +0000 (UTC) Received: from pdx1-sub0-mail-a305.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 591C450109B; Wed, 11 Jan 2023 13:14:47 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1673442887; a=rsa-sha256; cv=none; b=ynCs4Alrepdr0PyumwlM0uGmRj9sn7A9UnH8cUlxJ/0COm4al7+roERBd7wOqz2ZEdOl3+ ZmhMy3jIu1zNy5CPSrz6qea1uz33oR1EBJLbAHnpw7RCP/HOjvEpnfgWpSWTLaGGJeC9of vgbYHBWh/dYz5sAIdXOuftEx+a+vb3nCBVigVfRdNxlN1vIKGPc8JBSv+cHR9stTJDnoT/ A1Pyf92/zKxojlmAN180iEZ0NJOcu83wiLlFwmeu7AQeAIpmQg3ueK08c+0tsFy8vFfu2l OGFk4C5mfwOYN8kV97rEpohBLKw4FJYnezeI5gpKKl+taT3cQ3U+ph2a94MF3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1673442887; 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:dkim-signature; bh=DFr8ecRnNcGYzKzc60GGDOMzPOBzm/tU/orhgkCfQBQ=; b=ANopA+8M00YOVlChZupEJZrssld/x4NIWYWXp/cvMitmSpmzZ/+ePq7sKSRyJy/k4/nIKx MOTaz9SKhlzw3tUkoEIOM+6B6AtVAqUqulfrWoEbMLwDKJ1JtxJMrXtOjRajQQ+5DNOxNk yyOfEf+MPDb0alRIPpE5pvbWXTDZEY1JdKHA4+Gp2FYvRzV2gqKBcVWfCx8nqgUIU6yy27 /jGsP//lusx52YAy/7Nl/XORzX4cH0PmR4PC1dvE5ath6XZqC+ztMft2lkw39gnJeRjJIr e3hoCT6uqWN9I8StHa6x9810BbOhT6b+G20KrG+FJZN8XctvxrKnTHpQ1m6zjA== ARC-Authentication-Results: i=1; rspamd-6f569fcb69-gxlff; auth=pass smtp.auth=dreamhost smtp.mailfrom=siddhesh@gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Skirt-Decisive: 6ed9ef1079149480_1673442887608_2595647062 X-MC-Loop-Signature: 1673442887608:2280316232 X-MC-Ingress-Time: 1673442887608 Received: from pdx1-sub0-mail-a305.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.109.196.237 (trex/6.7.1); Wed, 11 Jan 2023 13:14:47 +0000 Received: from [192.168.0.182] (bras-base-toroon4834w-grc-23-76-68-24-147.dsl.bell.ca [76.68.24.147]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a305.dreamhost.com (Postfix) with ESMTPSA id 4NsSny5ngQzRS; Wed, 11 Jan 2023 05:14:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gotplt.org; s=dreamhost; t=1673442887; bh=DFr8ecRnNcGYzKzc60GGDOMzPOBzm/tU/orhgkCfQBQ=; h=Date:Subject:From:To:Cc:Content-Type:Content-Transfer-Encoding; b=JsFbG6Eq5Uz5BjTwLjhB8Y4/jjrjhPNCpowt34g2UVSySQiu87e56N22dko+WicYe QdCAURjWOyXRIFzoXtYvPHdECaa86MyuaIFguqbh8qfwdP2nR0TUp5qyAK7st67ZKi VOE/uQfScKe0IMyOrC72ECi4mWHXgxGXHCSlS5vbD5Fpmo5/8lWzsi0o9KpimYxWPw yc5EHEsxY62YO/wxpf8QpcmugPzZ/Mwm1CmrpsdeB5lPpejKHLzBSbEOpwGmk/irHF GS29LwEkc5UsNEw/HZEkn8mszpw+P75KE3jfWsYE6G52K+ztZ+Z0g8TL7ErTeV/VWA pYNH4HCtU/0Gg== Message-ID: <8fa0f5d5-7361-8c4b-f3c3-ae266b7ccdcf@gotplt.org> Date: Wed, 11 Jan 2023 08:14:45 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: [ping2][PATCH 0/2] __bos and flex arrays Content-Language: en-US From: Siddhesh Poyarekar To: gcc-patches@gcc.gnu.org Cc: jakub@redhat.com References: <20221221222554.4141678-1-siddhesh@gotplt.org> In-Reply-To: <20221221222554.4141678-1-siddhesh@gotplt.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3031.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Ping! On 2022-12-21 17:25, Siddhesh Poyarekar wrote: > Hi, > > The first patch in the series is just a minor test cleanup that I did to > make sure all tests in a test case run (instead of aborting at first > failure) and print the ones that failed. The second patch is the actual > fix. > > The patch intends to make __bos/__bdos do the right thing with structs > containing flex arrays, either directly or within nested structs and > unions. This should improve minimum object size estimation in some > cases and also bail out more consistently so that flex arrays don't > cause false positives in fortification. > > I've tested this with a bootstrap on x86_64 and also with > --with-build-config=bootstrap-ubsan to make sure that there are no new > failures due to this change. > > Siddhesh Poyarekar (2): > testsuite: Run __bos tests to completion > tree-object-size: More consistent behaviour with flex arrays > > .../g++.dg/ext/builtin-object-size1.C | 267 ++++++++-------- > .../g++.dg/ext/builtin-object-size2.C | 267 ++++++++-------- > .../gcc.dg/builtin-dynamic-object-size-0.c | 14 +- > gcc/testsuite/gcc.dg/builtin-object-size-1.c | 263 ++++++++-------- > gcc/testsuite/gcc.dg/builtin-object-size-12.c | 12 +- > gcc/testsuite/gcc.dg/builtin-object-size-13.c | 17 +- > gcc/testsuite/gcc.dg/builtin-object-size-15.c | 11 +- > gcc/testsuite/gcc.dg/builtin-object-size-2.c | 287 +++++++++--------- > gcc/testsuite/gcc.dg/builtin-object-size-3.c | 263 ++++++++-------- > gcc/testsuite/gcc.dg/builtin-object-size-4.c | 267 ++++++++-------- > gcc/testsuite/gcc.dg/builtin-object-size-6.c | 267 ++++++++-------- > gcc/testsuite/gcc.dg/builtin-object-size-7.c | 52 ++-- > gcc/testsuite/gcc.dg/builtin-object-size-8.c | 17 +- > .../gcc.dg/builtin-object-size-common.h | 12 + > .../gcc.dg/builtin-object-size-flex-common.h | 90 ++++++ > ...n-object-size-flex-nested-struct-nonzero.c | 6 + > ...ltin-object-size-flex-nested-struct-zero.c | 6 + > .../builtin-object-size-flex-nested-struct.c | 22 ++ > ...in-object-size-flex-nested-union-nonzero.c | 6 + > ...iltin-object-size-flex-nested-union-zero.c | 6 + > .../builtin-object-size-flex-nested-union.c | 28 ++ > .../gcc.dg/builtin-object-size-flex-nonzero.c | 6 + > .../gcc.dg/builtin-object-size-flex-zero.c | 6 + > .../gcc.dg/builtin-object-size-flex.c | 18 ++ > gcc/testsuite/gcc.dg/pr101836.c | 11 +- > gcc/testsuite/gcc.dg/strict-flex-array-3.c | 11 +- > gcc/tree-object-size.cc | 150 ++++----- > 27 files changed, 1275 insertions(+), 1107 deletions(-) > create mode 100644 gcc/testsuite/gcc.dg/builtin-object-size-common.h > create mode 100644 gcc/testsuite/gcc.dg/builtin-object-size-flex-common.h > create mode 100644 gcc/testsuite/gcc.dg/builtin-object-size-flex-nested-struct-nonzero.c > create mode 100644 gcc/testsuite/gcc.dg/builtin-object-size-flex-nested-struct-zero.c > create mode 100644 gcc/testsuite/gcc.dg/builtin-object-size-flex-nested-struct.c > create mode 100644 gcc/testsuite/gcc.dg/builtin-object-size-flex-nested-union-nonzero.c > create mode 100644 gcc/testsuite/gcc.dg/builtin-object-size-flex-nested-union-zero.c > create mode 100644 gcc/testsuite/gcc.dg/builtin-object-size-flex-nested-union.c > create mode 100644 gcc/testsuite/gcc.dg/builtin-object-size-flex-nonzero.c > create mode 100644 gcc/testsuite/gcc.dg/builtin-object-size-flex-zero.c > create mode 100644 gcc/testsuite/gcc.dg/builtin-object-size-flex.c >