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

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Martin Sebor from comment #0)
> In the test case below GCC folds the second test (as expected, on the
> assumption that distinct declarations refer to distinct objects) but fails
> to fold the first.
> 
> Clang folds both (into false and true, respectively).  GCC will only do that
> if a and b are static or local.
> 
> Same with extern arrays of known size.
> 
> $ cat x.c && gcc -O2 -S -Wall -Wextra -fdump-tree-optimized=/dev/stdout
> -fno-common x.c
> extern int a, b;

Why can't a and b point to the same address?

Reply via email to