From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2209) id E1737384640C; Thu, 9 May 2024 17:11:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E1737384640C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1715274690; bh=VyqHzbdM8k3YChUcseU0AORMS1Wje2YU0ThiIdFxSk8=; h=From:To:Subject:Date:From; b=YUjuVDT9cfeXAGs0t3iSGL235QOm/UDKLao3aRJhu/whcGYssnATn+eyBsttZ6+sq L+NeQ4Qtfi6PYt77xntEnkMUgBwf+ISObuUqu35Vu0DeFqvZrMEo3t7OZsrycT/dj6 TLim+hGgw5piTESOYXfG54+22CgyH6+pgob8zVIA= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: David Malcolm To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-8748] testsuite, analyzer: add test case [PR108171] X-Act-Checkin: gcc X-Git-Author: David Malcolm X-Git-Refname: refs/heads/releases/gcc-13 X-Git-Oldrev: a0b13d0860848dd5f2876897ada1e22e4e681e91 X-Git-Newrev: 44968a0e00f656e9bb3e504bb2fa1a8282002015 Message-Id: <20240509171130.E1737384640C@sourceware.org> Date: Thu, 9 May 2024 17:11:30 +0000 (GMT) List-Id: https://gcc.gnu.org/g:44968a0e00f656e9bb3e504bb2fa1a8282002015 commit r13-8748-g44968a0e00f656e9bb3e504bb2fa1a8282002015 Author: David Malcolm Date: Thu May 9 13:09:28 2024 -0400 testsuite, analyzer: add test case [PR108171] The ICE in PR analyzer/108171 appears to be a dup of the recently fixed PR analyzer/110882 and is likewise fixed by it; adding this test case. gcc/testsuite/ChangeLog: PR analyzer/108171 * gcc.dg/analyzer/pr108171.c: New test. (cherry picked from commit r14-2957-gf80efa49b7a163) Signed-off-by: David Malcolm Diff: --- gcc/testsuite/gcc.dg/analyzer/pr108171.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/gcc/testsuite/gcc.dg/analyzer/pr108171.c b/gcc/testsuite/gcc.dg/analyzer/pr108171.c new file mode 100644 index 000000000000..5f7b9fd78754 --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/pr108171.c @@ -0,0 +1,31 @@ +struct nl_context { + void *cmd_private; +}; + +struct sfeatures_context { + int a; + int req_mask[0]; +}; + +int set_sf_req_mask_idx; + +extern void fill_legacy_flag(); + +void +fill_sfeatures_bitmap(struct nl_context *nlctx) { + while (nlctx) { + fill_legacy_flag(); + struct nl_context __trans_tmp_1 = *nlctx; + struct sfeatures_context *sfctx = __trans_tmp_1.cmd_private; + sfctx->req_mask[set_sf_req_mask_idx] |= 1; + } +} + +void +nl_sfeatures() { + struct nl_context nlctx; + struct sfeatures_context *sfctx; + nlctx.cmd_private = &sfctx; + sfctx = 0; + fill_sfeatures_bitmap(&nlctx); +}