This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
At the C++ ABI switch, make -mregparm=1 the default on x86?
- To: egcs at egcs dot cygnus dot com
- Subject: At the C++ ABI switch, make -mregparm=1 the default on x86?
- From: Jamie Lokier <egcs at tantalophile dot demon dot co dot uk>
- Date: Wed, 8 Mar 2000 23:51:33 +0100
(x86 only)
Once upon a time, I was doing experiments with an embedded x86
application using C++.
I tried the various -mregparm options: -mregparm=1 seemed to give the
smallest code in general.
I never tried timing the code, but I would imagine it is as faster or
similar speed to the default, which is -mregparm=0.
(I would have mixed it with -mrtd, but __attribute__ ((regparm (0),
cdecl)) didn't work at the time. I wonder if it does now).
It's not terribly easy to use this calling convention with standard
libraries because they are compiled to use the other convention -- all
on the stack, caller pops.
However, there is movement afoot to change the C++ ABI. In that case,
maybe that would be a good time to declare that C++ calls use the
-mregparm=1 calling convention?
-- Jamie