This is the mail archive of the gcc-help@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: Curious global variable bug? Bad assumptions on my part?


Thanks for the fast and detailed responses. Figured it was my
assumptions on multi-threaded C.

Thanks,
Tynan

On Thu, Feb 14, 2008 at 10:43 AM, Tony Wetmore
<tony.wetmore@solipsys.com> wrote:
> Tynan Wilke wrote:
>  > So, the -O0 is doing what I would expect, but the -O1 version IS
>  > testing the global variable the first pass, but then never jumping
>  > back to the 0x0804853a to retrieve the new global value and then
>  > re-test. Is this right?
>
>  That sounds right.  Because GCC thinks the value is never going to
>  change, it doesn't ever bother to look at it again after the first check.
>
>  --
>  Tony Wetmore
>
>
>


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