The following code is a reduced case from the libc++ lexicographical comparison test, https://godbolt.org/z/MnjWbK3ca. This fails when the GVN pass attempts to compare the two values from the GEP. I reduced it further, but wasn't sure if it was the same issue so I figured I'd show both https://godbolt.org/z/hE6d6P6s3, this one is shorter.
The following code is a reduced case from the libc++ lexicographical comparison test, https://godbolt.org/z/MnjWbK3ca. This fails when the GVN pass attempts to compare the two values from the GEP. I reduced it further, but wasn't sure if it was the same issue so I figured I'd show both https://godbolt.org/z/hE6d6P6s3, this one is shorter.