From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32697 invoked by alias); 31 Mar 2003 12:46:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 32679 invoked by uid 71); 31 Mar 2003 12:46:01 -0000 Date: Mon, 31 Mar 2003 12:46:00 -0000 Message-ID: <20030331124601.32678.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Hans-Peter Nilsson Subject: Re: target/6882: [SPARC] Useless stack adjustment code Reply-To: Hans-Peter Nilsson X-SW-Source: 2003-03/txt/msg02102.txt.bz2 List-Id: The following reply was made to PR target/6882; it has been noted by GNATS. From: Hans-Peter Nilsson To: Eric Botcazou Cc: dann@godzilla.ics.uci.edu, , , Subject: Re: target/6882: [SPARC] Useless stack adjustment code Date: Mon, 31 Mar 2003 07:44:27 -0500 (EST) On Mon, 31 Mar 2003, Eric Botcazou wrote: > > No, it seems a valid optimization request to not emit the > > stack-adjustment code. Could you find a *specific* reason for > > the stack-adjustment code? (Please state that in the PR.) > > No, I don't see a "specific" reason. But: > - functions from the same translation unit that call it (and that appear > after it in normal mode, but the restriction is lifted with > -funit-at-a-time) don't actually emit the call, > - would the benefit be worth it in real life, given that the costly operation > is to call the function itself (for nothing)? I think the real optimization > is not to emit the call at all. Now you're arguing about the *value of the optimization*. I was arguing about *closing the PR for the wrong reason*. It seemed to indicate a misunderstanding about GCC rather than a special need on the SPARC. For example, the CRIS and MMIX targets don't emit that kind of redundant stack frame. Having said that, let's continue to the *new* discussion. You can't optimize out the call from other translation units. Not being a SPARC maintainer I won't try to judge on the benefit, but it looks simple enough and seems worthwhile. C++ tends to generate a lot of small trivial functions. brgds, H-P