https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108968

--- Comment #12 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
(In reply to Andrew Cooper from comment #9)
[...snip...]
> Our code does fundamentally rely on get_cpu_info() always returning the same
> pointer (on a single CPU).  For example, `current` is defined as
> `get_cpu_info()->current` and we do expect that to yield the same pointer
> when used multiple times.
> 
> Even if the analyser was interpreting the generated asm, there's no way it
> could prove this without knowing the size/alignment constraints of our
> stacks.

Another issue is that even if the analyzer "knows" that get_cpu_info() always
returns the same value, it doesn't know what memory is being pointed to, and so
has to assume that in:

   T old_value = get_cpu_info()->current;

   some_function_call ();

   T new_value = get_cpu_info()->current;

that old_value doesn't necessarily equal new_value, since some_function_call ()
could have modified the value of "current".

Reply via email to