From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D030A3858296; Wed, 8 Mar 2023 20:47:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D030A3858296 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678308477; bh=yCLK7Yt1GTKXkZweSosTKWfqOu0inBl/5987cMwf3EE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HHLP1dpuPw1HPqVF3M64ExYCN9UrPMv88qwK9aQMx+7WBlles6IKxSal/qqCSuLG5 ZCMZpr1iJyfm6TEgvVnESd3Hm9XWfNyUsdwSjnHJAOtTQ2zwv2OtVbVtUfddYJiqnM ZvhgvGmSs4DxUNxeNYiuC4gULW80jPlFUTKGfJ3c= From: "qinzhao at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/108896] provide "element_count" attribute to give more context to __builtin_dynamic_object_size() and -fsanitize=bounds Date: Wed, 08 Mar 2023 20:47:57 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: qinzhao at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: qinzhao at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108896 --- Comment #33 from qinzhao at gcc dot gnu.org --- (In reply to Martin Uecker from comment #32) > > > > struct foo { > > > > =C2=A0=C2=A0int len; > > > > =C2=A0=C2=A0char (*buf)[.len]; > > > > }; > Here the last element is not a flexible array member but > a pointer to an array of size len. The size of the pointer is > fixed. Oh, that's right. then, just curious on how did you embed the '.len' information into IR?=