This is the mail archive of the
mailing list for the GCC project.
Re: Optimization of conditional access to globals: thread-unsafe?
From: Darryl Miles <firstname.lastname@example.org>
Date: Mon, 29 Oct 2007 04:53:49 +0000
> What are the issues with "speculative loads" ?
The conditional might be protecting whether the pointer is valid and
can be dereferenced at all.
void foo(int counter_is_valid)
And in another module that GCC can't see when compiling foo():
extern int *counter;
int a = 0;
counter = &a;