[Top] [All Lists]

Re: Compiler bug?

Subject: Re: Compiler bug?
From: Dom Sweetman <>
Date: Wed, 4 Jun 1997 22:27:29 +0100 (BST)
In-reply-to: <v03007800afbb922d6865@[]>
References: <v03007800afbb922d6865@[]>

>  I've got a possible compiler bug I was wondering you could help me with.
> Here's what I'm seeing in two places in the code (and who knows where else):
> In fork.c there is:
>       if (copy_mm(clone_flags,p))
>               goto bad_fork_cleanup_sighand;
> On entering this line of code, my "p" is valid (0x80fdb810) on exit from
> the code it is invalid (0xFFFFFFF). 

There ain't no compiler bug until the program does something wrong.  

My guess is that what you've got here is that the compiler is
allocating the value 'p' to a register (which may well be a good thing
to do).  The debugger then has to have its best shot at digging out
the value 'p' based on hints the compiler leaves around.  

It's not reasonable to expect the compiler/debugger to report a value
correctly when it's no longer needed; the compiler may have recycled
that register for something else, or the debugger lost track of it.

> If I put the following code immediately
> after the call:
>       p = *(&p);
> My pointer magically reappears. 

If you take the address of something (pretty much anywhere in the
function) the compiler will most likely refuse to keep the value in a
register - if you took the address someone else might be keeping a
pointer and changing the value through it.

Dominic Sweetman

<Prev in Thread] Current Thread [Next in Thread>
  • Compiler bug?, Timothy Stonis
    • Re: Compiler bug?, Dom Sweetman <=