We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
struct NODE{ struct NODE Succ; struct NODE Prev; }; struct LIST{ struct NODE *Head; struct NODE *Tail; int count; }; struct LIST *List; struct NODE *N; ...... for(N = List->Head;N;N = N->Succ) { ...... }
You were looking for the wrong kind of symptoms, then. The fact that two variables end up being placed in the same address, all by itself, tells you exactly nothing about the actual behaviour of the program. The compiler is perfectly allowed to re-use the memory positions used for 'List' to store something else in it after 'List' itself is no longer used. That's what the word "optimization" in "optimization level 8" is mainly about, after all. Without this kind of tricks, it would be close to impossible to fit any decent-sized C program into a typical 8051 device --- there simply isn't enough memory space to spare.