From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 128407 invoked by alias); 27 Sep 2018 19:47:58 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 128388 invoked by uid 89); 27 Sep 2018 19:47:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=HX-Received:sk:j26-v6m X-HELO: mail-ot1-f41.google.com Received: from mail-ot1-f41.google.com (HELO mail-ot1-f41.google.com) (209.85.210.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Sep 2018 19:47:56 +0000 Received: by mail-ot1-f41.google.com with SMTP id m23-v6so3802135otf.0 for ; Thu, 27 Sep 2018 12:47:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=R+bzo1qEnoe5Kx4f5z1IZPHDZixOIWQfoslX9nkNKxk=; b=EKUFDAxa83+flbVHEn0GEsbkEpKAqCFfVevmUH8UV79qsM55avflyhsAVkx8Uti6Cn hBwbTJ+C5YidvRjgEXtL4gyju+2mD5Ss5S862ra2+vNUnN4O99I4tm9R4+iWmLwiRc70 2pcyYosvKNd94eQzU8B2Omp/0u7DVR2ZRfZ+OcJkw/T8/468ZtSmLVfCMZO1DYY+BAH4 X34jXRoF1G4gFjC7ZZ0Mk36KU7I5EX9h6HWgyVFMczTu45KLMyFSB66eNC901wyhOk3i OF/7c6NCyhkqMmYj4jpR59MLgLpuojdDNEke+vdRPgY6Hv/xcqjXO77vVgJtnR/EfIiY 5JPg== MIME-Version: 1.0 Received: by 2002:a4a:4d44:0:0:0:0:0 with HTTP; Thu, 27 Sep 2018 12:47:14 -0700 (PDT) In-Reply-To: <87mus2oiae.fsf@oldenburg.str.redhat.com> References: <20180926181029.GA20898@intel.com> <87mus2oiae.fsf@oldenburg.str.redhat.com> From: "H.J. Lu" Date: Thu, 27 Sep 2018 19:51:00 -0000 Message-ID: Subject: Re: RFC: [PATCH] x86: Add -mzero-caller-saved-regs=[skip|used|all] To: Florian Weimer Cc: GCC Patches , Uros Bizjak Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2018-09/txt/msg01691.txt.bz2 On Thu, Sep 27, 2018 at 12:24 PM, Florian Weimer wrote: > * H. J. Lu: > >> +@item zero_caller_saved_regs("@var{choice}") >> +@cindex @code{zero_caller_saved_regs} function attribute, x86 >> +On x86 targets, the @code{zero_caller_saved_regs} attribute causes the >> +compiler to zero caller-saved integer registers at function return with >> +@var{choice}. @samp{skip} doesn't zero caller-saved integer registers. >> +@samp{used} zeros caller-saved integer registers which are used in >> +function. @samp{all} zeros all caller-saved integer registers. > > Perhaps =E2=80=9Caccording to @var{choice}:=E2=80=9D. And say that the d= efault for the > attribute is controlled by @option{-mzero-caller-saved-regs}? Sure. > (Maybe =E2=80=9Cskip=E2=80=9D should be none?) I have no strong opinion here. > I assume we can check for this use __has_attribute? We would use this Yes. > in the implementation of explicit_bzero in glibc. Good to know. >> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi >> index 7ef4e7a449b..796477452d5 100644 >> --- a/gcc/doc/invoke.texi >> +++ b/gcc/doc/invoke.texi > >> @@ -28459,6 +28459,16 @@ not be reachable in the large code model. >> @opindex -mindirect-branch-register >> Force indirect call and jump via register. > >> +@item -mzero-caller-saved-regs=3D@var{choice} >> +@opindex -mzero-caller-saved-regs >> +Zero caller-saved integer registers at function return with @var{choice= }. >> +The default is @samp{skip}, which doesn't zero caller-saved integer >> +registers. @samp{used} zeros caller-saved integer registers which are >> +used in function. @samp{all} zeros all caller-saved integer registers. >> +You can control this behavior for a specific function by using the >> +function attribute @code{zero_caller_saved_regs}. >> +@xref{Function Attributes}. > > See above regarding =E2=80=9Cwith @var{choice}=E2=80=9D. I will update it. Thanks. --=20 H.J.