This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/7799: [3.2/3.3 regression] Loop bug withoptimization flag -Os in gcc
- From: Morten Welinder <terra at diku dot dk>
- To: gcc at gcc dot gnu dot org
- Date: 13 Dec 2002 21:09:15 -0000
- Subject: 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