[llvm-bugs] [Bug 29118] LLVM O2: LLVM opt -O2 did wrong optimization happened on Power / x86.

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 25 20:16:27 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=29118

Wu Zhao <bluechristlove at 163.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---

--- Comment #6 from Wu Zhao <bluechristlove at 163.com> ---
Firstly, thanks Sanjay Patel and Michael Kuperstein. 

However, we must see carefully with this C++ code(not only IR). From the user
source code of C++ semantics, I do not think it should be UB. 

[code]
int main()
{
  typedef array<char, 10> Con;
  Con v0;
  __builtin_printf("%d\n", v0 == v0);
}
[/code]

In fact, I compare it with the object v0 self, why the compiler said to me it
is not equal when I use O2? In fact, this case can be compiled with GCC / xlC
and so on (even with O2, O3). Clang passed O0 and Clang 3.5 can pass O2. For
main trunk of Clang, it can pass O0/O1.  So I think it is not invalid test
cases. Additionally, the container of array implementation is from our libc++
and affects us to use libc++. We should resolve it for our libc++ to be used
better experience too.

Thanks.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160826/e7ccacdd/attachment.html>


More information about the llvm-bugs mailing list