From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19609 invoked by alias); 24 Apr 2003 04:36:00 -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 19591 invoked by uid 71); 24 Apr 2003 04:36:00 -0000 Resent-Date: 24 Apr 2003 04:36:00 -0000 Resent-Message-ID: <20030424043600.19589.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, pinskia@physics.uc.edu Received: (qmail 18590 invoked by uid 48); 24 Apr 2003 04:32:22 -0000 Message-Id: <20030424043222.18589.qmail@sources.redhat.com> Date: Thu, 24 Apr 2003 04:36:00 -0000 From: pinskia@physics.uc.edu Reply-To: pinskia@physics.uc.edu To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: optimization/10474: gcc should be able to delay the setup of the frame pointer X-SW-Source: 2003-04/txt/msg01013.txt.bz2 List-Id: >Number: 10474 >Category: optimization >Synopsis: gcc should be able to delay the setup of the frame pointer >Confidential: no >Severity: non-critical >Priority: low >Responsible: unassigned >State: open >Class: pessimizes-code >Submitter-Id: net >Arrival-Date: Thu Apr 24 04:36:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Andrew Pinski >Release: version 3.4 20030422 >Organization: >Environment: powerpc-apple-darwin6.5 >Description: gcc should be able to delay the setup of the frame pointer untill after if/switch statements that return directly/or can be sibcalled. This will cause the compiler to be faster (ie rtx_equal_p is called a lot and does simple checks at the beginning of the function which on PPC does not need a stack frame). >How-To-Repeat: gcc -O3 -S -o - delayframe.c -static -fnew-ra (any PPC machine is fine for this) and see that g is the same as f but for the case of when r3 is zero, there are less instructions to be excuted, lets say the probability of r3 is more than 25% of the time, this would be a win. This is also win on x86 with -fomit-frame-pointer, really only a win without if the probability of the argument being zero is very high (do not know how high though). in the case of gcc, the probability is really high, at least for the c++ code I was looking at. >Fix: Have the stack frame creation be able to be delayed. >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: application/octet-stream; name="delayframe.c" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="delayframe.c" c3RhdGljIHZvaWQgZ18xKGludCopOwoKdm9pZCBmKGludCAqaSkKewoJaWYgKCFpKQoJCXJldHVy bjsKCWVsc2UKCXsKCQlwcmludGYoIkhpIik7CgkJKmk9MDsKCX0KfQoKdm9pZCBnKGludCAqaSkK ewoJaWYgKCFpKQoJCXJldHVybjsKCWVsc2UKCQlnXzEoaSk7Cn0KCnN0YXRpYyBfX2F0dHJpYnV0 ZV9fKChfX25vaW5saW5lX18pKSB2b2lkIGdfMShpbnQgKmkpCnsKCXByaW50ZigiSGkiKTsKCSpp ID0gMDsKfQo=