This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/78035] Inconsistency between address comparison and alias analysis
- From: "krister.walfridsson at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 02 Nov 2016 21:36:37 +0000
- Subject: [Bug tree-optimization/78035] Inconsistency between address comparison and alias analysis
- Auto-submitted: auto-generated
- References: <bug-78035-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78035
krister.walfridsson at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |krister.walfridsson at gmail dot c
| |om
--- Comment #9 from krister.walfridsson at gmail dot com ---
Doesn't this just introduce more inconsistencies in the compiler? For example
extern int a;
extern int b;
int foo(void)
{
a = 1;
b = 5;
a++;
return &a != &b;
}
optimizes to
foo:
movl $a, %eax
movl $5, b(%rip)
movl $2, a(%rip)
cmpq $b, %rax
setne %al
movzbl %al, %eax
ret
That is, the accesses to a and b are optimized as if they are distinct, even
though the compiler keeps the comparison of the addresses.
I cannot think of a reasonable use case where you must handle comparisons of
the addresses as currently implemented while allowing other optimizations as if
the objects are distinct, so I'd say the bug from the original description is
that we were "being too conservative in bar"...