From mboxrd@z Thu Jan 1 00:00:00 1970 From: dewar@gnat.com To: egcs@tantalophile.demon.co.uk, schwab@suse.de Cc: aoliva@redhat.com, denisc@overta.ru, dkorn@pixelpower.com, gcc@gcc.gnu.org, peter.osterlund@mailbox.swipnet.se Subject: Re: Bug in loop optimize (invalid postinc to preinc transformation) Date: Sun, 31 Dec 2000 08:30:00 -0000 Message-id: <20001231163045.5B3B534D81@nile.gnat.com> X-SW-Source: 2000-12/msg00886.html <> Indeed. The important thing to remember in C is that the semantic model of a pointer is a pair (pointer-to-object, offset). Address arithmetic just modifies the offset, comparison compares only the offsets (and is undefined if the pointer-to-object values are different). Of course in practice the implementation is typically a single pointer from a flat space, representing the sum of the two components, but the proper semantic model needs to be kept in mind, and code that does not respect this semantic model has undefined effects. As C compilers get more clever, they are likely to be less permissive to abuses of the semantics :-)