This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: More fun with aliasing - removing assignments?
Diego Novillo <dnovillo@redhat.com> writes:
> Does the language allow the creation of address locations out of
> arbitrary integer values?
Yes.
6.3.2.3 Pointers
5 An integer may be converted to any pointer type. [...]
> Is the dereference of such an address a defined operation?
It is implemetation-defined.
[...] Except as previously specified, the result is
implementation-defined, might not be correctly aligned, might not
point to an entity of the referenced type, and might be a trap
representation.
Also, the integer may have been the result of casting a valid pointer, in
which case the operation is fully defined (assuming the integer is wide
enough).
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."