From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D4BEB385840B; Mon, 7 Aug 2023 13:42:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D4BEB385840B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691415777; bh=WbmkbyNQMzfstmaraji38z2tsy8ccNsAi4oJjgYYr9Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=WwTpwU2NoWPlQD/GtJRxoLB6er27ba+gw1AZ8ow8IO8RjBuw5XWvxNZgG+7gIuz0Y cXGcL+DDrX31F7VXjve9n9kqkl+RhmTcQWZTOh4Fb7aCNDn31EjdyT4p6wczRV0ss7 41GxlUVftX+unYF33uZ5DTxf7bEfwt4KMlKZnArk= From: "fw 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 13:42:57 +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: fw 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 #5 from Florian Weimer --- (In reply to Michael Matz from comment #3) > 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,= but > meanwhile irrelevant, reasons, so my approach above tried to rectify this. >=20 > The clang attributes seem to go against that general idea, they move all = regs > (or all general regs) into being callee-saved (except, strangely for > aarch64?). This is intended for functions that are called conditionally, but rarely, s= uch as debug logging. It's not a generally useful calling convention. > It also makes argument registers be callee-saved, which is very > unconventional. Isn't this done for the this pointer in some C++ ABIs? > Does the clang implementation take into account the various problematic > cases that arise when calling a normal function from a (say) preserve_all > function > (hint: such call can't usually be done)? How so? We need to version the __preserve_most__ attribute with the ISA lev= el, of course.=