From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5919 invoked by alias); 16 Oct 2011 14:30:52 -0000 Received: (qmail 5909 invoked by uid 22791); 16 Oct 2011 14:30:51 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-vw0-f47.google.com (HELO mail-vw0-f47.google.com) (209.85.212.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 16 Oct 2011 14:30:38 +0000 Received: by vwe42 with SMTP id 42so1211625vwe.20 for ; Sun, 16 Oct 2011 07:30:37 -0700 (PDT) Received: by 10.52.27.208 with SMTP id v16mr16507585vdg.22.1318775437549; Sun, 16 Oct 2011 07:30:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.92.83 with HTTP; Sun, 16 Oct 2011 07:30:16 -0700 (PDT) In-Reply-To: References: From: Ulrich Drepper Date: Sun, 16 Oct 2011 23:37:00 -0000 Message-ID: Subject: Re: asm in inline function invalidating function attributes? To: Richard Guenther Cc: gcc@gcc.gnu.org Content-Type: text/plain; charset=UTF-8 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg00242.txt.bz2 On Sun, Oct 16, 2011 at 06:31, Richard Guenther wrote: > The question is now, of course why you need to emit calls > from an asm() statement, something which isn't guaranteed > to work anyway (IIRC). It's not guaranteed to work in general. The problem to solve is that I know the function which is called is not clobbering any registers. If I leave it with the normal function call gcc has to spill registers. If I can hide the function call the generated code can be significantly better. An alternative solution would be to have a function attribute which allows me to specify which registers are clobbered. Or at least an attribute which says none are clobbered.