From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 390613858CDB; Fri, 30 Sep 2022 01:54:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 390613858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664502852; bh=Niobua26aqbkL3+e0xp02lEsJJRdJDWBRr9gLFFsnmQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=uqX/WCEYfKfZg0SQqWF8aaK6ibNaagItglX9O1j6BMJTIWF2B6N9doZKIqeNn0vxe 3spApHy4QL0UjduvEGyIdW/ypjDnPQyQEA00W24lQuOOeAr4sGpoFE7k7Ueb9b8zgz mqTtHQsKif8Yro+6hHmxbs0uAUkw4/Wrp818kM/Q= From: "kees at outflux dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/96503] attribute alloc_size effect lost after inlining Date: Fri, 30 Sep 2022 01:54:11 +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: kees at outflux dot net 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: cc attachments.created 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 Kees Cook changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kees at outflux dot net --- Comment #1 from Kees Cook --- Created attachment 53643 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D53643&action=3Dedit PoC showing unexpected __bdos results across inlines Fixing this is needed for the Linux kernel to do much useful with alloc_siz= e. Most of the allocators are inline wrappers, for example. This can be additionally shown to break __builtin_dynamic_object_size(), wh= ich means all FORTIFY_SOURCE of alloc_size-marked inlines is broken. :( https://godbolt.org/z/jTKjY3s1j=