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]
Other format: [Raw text]

Re: optimization/7799: [3.2/3.3 regression] Loop bug withoptimization flag -Os in gcc


I'll give it another try...  Recall that all this is for i86.

1. sizeof(int) == sizeof(char) == 1.  int is four bytes wide.
2. NULL represented as address 0.
3. OS support to read/write unaligned.
4. OS support to read/write wrapped, e.g., read four bytes at 0xffffffff.

(1 is not unheard of, 2 is normal, 3 is normal on i86, 4 is bizarre.)

malloc (10) can then return address 0xffffffff as the address of
10 ints.

I think assumption 1 makes impossible to do valid pointer gymnastics
to get NULL from 0xffffffff.  Everything you do is going to be in
steps of four on the address level.

Morten


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