This is the mail archive of the gcc@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]

C semantics question...



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


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