From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EFC1C385BF81; Wed, 8 Apr 2020 06:45:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EFC1C385BF81 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1586328323; bh=jx58VeSvc+vG/uCVHU4G8GMkb4DNZW16+CegEtg1vyw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Dfx3kcMMVRweuqiXwjoCa0gTKABWboNvWFKnizS5jfy2HgD7p2Dsfj6Ff1h/i92Ib TLmoDksAM7pwxxJpbX2iV/H9VtPQqBMxgp7MKJonkxRubUC2kgfgzJXKY/32q9Ii2n x/W3wRMhJ/ZsPaayvkDiZvGy/Wvgdmh4mlmDfUaA= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/94527] RFE: Add an __attribute__ that marks a function as freeing an object Date: Wed, 08 Apr 2020 06:45:23 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: rguenth 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: component 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2020 06:45:24 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94527 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Component|tree-optimization |middle-end --- Comment #5 from Richard Biener --- Agreed that having an attribute to annotate free-like functions similar to = how we have one for malloc-like funtions would be nice. How are semantics in the case such a function throws? Or shall 'free' imply nothrow and that it doesn't return abnormally (it doesn't call longjmp), 'leaf' would be a bit too strong but possibly easiest to require? We could also simply say that the pointed to object is released (it's conte= nts become undefined) upon exiting the function by any means (normal return, EH or abnormal).=