Stange gcc 3.3 bug on Linux/ia64

Jim Wilson wilson@tuliptree.org
Fri Jul 4 02:19:00 GMT 2003


H. J. Lu wrote:
> It got stranger and stranger. I created a small Makefile to recreate
> the problem. If I comment out 
> PWD = $${PWDCMD-pwd}

This changes the environment size, which in turn changes the stack 
addresses of all local variables.  This can affect several different 
kinds of bugs.  If there is code that takes the address of a stack 
variable, and then does something to it, like create a hash index, then 
you get different hash indices with different environment sizes.  There 
can also be problems if you have code reading an uninitialized local 
variable, it may end up reading different garbage on the stack because 
of different stack alignment/layout.  Or if you have a stray pointer or 
out-of-bounds array access to a stack slot, you can get different 
behaviour with environment size changes.

Jim




More information about the Gcc mailing list