From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6E2D73858418; Mon, 7 Aug 2023 12:55:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6E2D73858418 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691412905; bh=eUebi57SoM1JU9rC2lUcXDITkG0RCmTyLoXqY6eBJus=; h=From:To:Subject:Date:In-Reply-To:References:From; b=x+SMo5Bb9rwBKm0s5S24u4F8dJX6IIHa7WQHM+/79qdgr7JEzCGz7J22frDkx3I9d /A6ZxSUYg3c2oUQrd5J1QFSnvSW3XUf1kz6HzN/4iG9eIVdMRnv9SZwKw/HGGsqg0f 0MjhjbRWYagMb1n+IceAq7xluUfkGgI1yvOttL2o= From: "matz at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/110899] RFE: Attributes preserve_most and preserve_all Date: Mon, 07 Aug 2023 12:55:04 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: matz at gcc dot gnu.org 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=3D110899 --- Comment #3 from Michael Matz --- Huh, since when does clang implement this? See also=20 https://gcc.gnu.org/pipermail/gcc-patches/2023-July/624004.html where I asked for comments about a similar, but not same, mechanism. I came from the angle of preserving a couple of SSE registers on x86-64. For ABIs you generally want a good mix between caller- and callee-saved registers. The x86-64 psABI didn't do that on the SSE regs for conscious, b= ut meanwhile irrelevant, reasons, so my approach above tried to rectify this. The clang attributes seem to go against that general idea, they move all re= gs (or all general regs) into being callee-saved (except, strangely for aarch6= 4?). It also makes argument registers be callee-saved, which is very unconventio= nal. Does the clang implementation take into account the various problematic cas= es that arise when calling a normal function from a (say) preserve_all function (hint: such call can't usually be done)? Does exception handling, setjmp/longjmp and make/swapcontext interact with the clang attributes? That said: the implementation itself (after a more detailed spec) can be implemented in the same framework like the above patch. (It's possible that something more needs doing for the unusual situation that argument regs are then callee-saved).=