This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

optimization/10474: gcc should be able to delay the setup of the frame pointer


>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=


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]