From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3DD603858404; Wed, 25 Oct 2023 13:03:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3DD603858404 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1698239024; bh=TIuhILdywljKvVg8pEGJf0+yZkttMzRQbHZtWC2ZFA8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=EaGnCIx4mDeKciSFADHs1jxjgo6IGKfIT4hKl1zuz9Zy8JpLDTSKrASwNbvhLhvfZ +BkJ31YY8OJP4HzRfrHZX/Kth7/T2B9rye68Nd6Tzlhuu9jAE47Mhd4KCm66YaVpkL ibD1c4NDIu0ux+cH/mOpQvRl+gqv9epY8mpHkhUo= From: "muecker at gwdg dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/96503] attribute alloc_size effect lost after inlining Date: Wed, 25 Oct 2023 13:03:43 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: muecker at gwdg dot de X-Bugzilla-Status: UNCONFIRMED 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=3D96503 --- Comment #7 from Martin Uecker --- Am Mittwoch, dem 25.10.2023 um 11:08 +0000 schrieb siddhesh at gcc dot gnu.= org: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96503 >=20 > --- Comment #6 from Siddhesh Poyarekar --- > So basically, >=20 > __builtin_with_access(void *ptr, size_t size, int access) >=20 > where access =3D=3D >=20 > -1: Unknown access semantics > 0: none > 1: read_only > 2: write_only > 3: read_write >=20 > should address both access and alloc_size and even counted_by. =C2=A0 Yes, sounds good. > We would need > to emit the builtin in the caller as well as callee of the function that = has > the access attribute while for alloc_size, we only need to emit this in t= he > caller. Yes, makes sense, although I guess caller part for "access" is only for warning and not relevant for BDOS, so could=C2=A0 potentially stay as it is for now. For __builtin_with_access we probably only want to allow reducing the object size, while the 'extend_size' workaround=C2=A0 used by systemd (cf comment #4) would need to extend it.=C2=A0 Maybe we need another flag? Martin=