From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0FFDC3857803; Thu, 23 Feb 2023 21:13:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0FFDC3857803 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677186818; bh=3kO1Gpvrn8MKGI4+pSU+IDB8JR41cYNX0lFhpOPwaao=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Xt55Nk5uo0XeZNL0qTNjymE8d5ThPw+NunLVX6+4OuvDoDTqRO0AuzKepfhkfnA4i 6I4courmztPvG8PhLLOY+6SWd6fvlLFsPVmJPSWr7UDhsxpKo3rFQMX3L+Z3CcpH1a SkCdHpGM9+92B2KAvPiZDzKEwm6+HQkji4fJew4I= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/108894] -fsanitize=bounds missing bounds provided by __builtin_dynamic_object_size() Date: Thu, 23 Feb 2023 21:13:37 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned 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=3D108894 --- Comment #10 from Jakub Jelinek --- (In reply to qinzhao from comment #9) > (In reply to Jakub Jelinek from comment #8) > > Well, -fsanitize=3Dbounds-strict certainly shouldn't imply > > -fstrict-flex-arrays=3D2, > > it should just treat [1] and [4] (but I think it does even [0] right no= w) as > > regular arrays for the purposes of the sanitization. >=20 > with a small example I just tested, with -fsanitize=3Dbounds-strict, I can > see, it treats: > [], [0] as flexible array members; > but > [1], [4] as regular arrays >=20 > This is the same level as -fstrict-flex-arrays=3D2.=20 > should we just keep its default behavior like this, or let it more strict= ly > as -fstrict-flex-arrays=3D3? I'd keep its current behavior, perhaps except for -fsanitize=3Dbounds-strict -fstrict-flex-arrays{,=3D3} so that -fsanitize=3Dbounds -fstrict-flex-array= s{,=3D3} wouldn't be more strict than the former.=