This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
C semantics question...
- To: <gcc at gcc dot gnu dot org>
- Subject: C semantics question...
- From: Chris Lattner <sabre at nondot dot org>
- Date: Fri, 29 Jun 2001 15:13:39 -0500 (CDT)
Hi All.
I'm working on a port to a machine that really likes to have things in the
smallest possible registers as possible, at all times (more efficient ops,
more registers available, etc). As such, I would like to be able to
return HImode values in 16 bit registers and QImode values in 8 bit
registers.
Unfortunately, GCC (following the C spec), promotes char and short
variables to int before returning them (through the
C_PROMOTING_INTEGER_TYPE_P macro, among others). Similarly, float is
promoted to double when returned.
Is it safe [ie, no user visible effects] to disable this promotion,
assuming that all functions are accurately prototyped before used?
I'm having trouble thinking of an instance where this would be a problem.
The backend is already able to disable argument type extension, so I think
it would be similar to that.
Thanks,
-Chris