Register unions

Guy Harris guy at auspex.UUCP
Fri Oct 28 09:52:21 AEST 1988


>Even if the hardware could not support a register union of incompatible
>data types, the information would be valuable to an optimizer.
>"Register," in addition to expressing a storage preference, informs the
>compiler that the variable is non-addressable, and that the compiler
>needn't worry about the contents changing.

Well, optimizers of that level of sophistication often completely ignore
"register" declarations and decide for themselves what should go into
registers....  (Wasn't there some other keyword people were talking
about at one point for saying that there wouldn't be any aliases for
some location? :-) :-) :-) :-) :-) :-) :-) :-) :-))

The compiler can generally figure out for itself whether you're taking
the address of some local variable or not; it tends not to need the
assistance of a "register" declaration.



More information about the Comp.lang.c mailing list