Re: [PATCH GIT 0.6] make use of register variables & size_t

From: Valdis . Kletnieks
Date: Mon Apr 25 2005 - 13:56:55 EST

On Mon, 25 Apr 2005 20:15:22 +0200, Matthias-Christian Ott said:

> But this makes, like "register", direct use of processor registers (it stores int arguments in eax, ebx, etc.).

Control how many registers are used to pass integer arguments. By
default, no registers are used to pass arguments, and at most 3
registers can be used. You can control this behavior for a
specific function by using the function attribute `regparm'.
*Note Function Attributes::.

*Warning:* if you use this switch, and NUM is nonzero, then you
must build all modules with the same value, including any
libraries. This includes the system libraries and startup modules.

If it weren't for that *warning*, you could get away with making this another
auto-optimizable value (similar to register allocation inside a function).
Alas, the caller and called functions can be in different .o files, and as
a result, you need to be able to specify the NUM to use to each invocation
of gcc involved, as there's an ABI change involved....

> Stay serious. The book only teaches you ISO-C 99 like many other books. So
> where's your problem?

The problem is the supposition that the implied 3 week's experience in a
language makes anybody qualified to comment on how to use it truly effectively
(for that matter, I've been programming in C since SunOS 3.2, literally 2
decades ago, and I'm still finding little corners I didn't previously know...)

Attachment: pgp00000.pgp
Description: PGP signature