[llvm-bugs] [Bug 40641] New: Clang generates wrong optimized code for std::rotate followed by std::min_element with libc++
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Feb 7 02:28:03 PST 2019
https://bugs.llvm.org/show_bug.cgi?id=40641
Bug ID: 40641
Summary: Clang generates wrong optimized code for std::rotate
followed by std::min_element with libc++
Product: clang
Version: 7.0
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: steffen.muething at iwr.uni-heidelberg.de
CC: blitzrakete at gmail.com, dgregor at apple.com,
erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
richard-llvm at metafoo.co.uk
Created attachment 21442
--> https://bugs.llvm.org/attachment.cgi?id=21442&action=edit
Failing code, check return code to see if it worked
When compiling with clang 7 "-std=libc++ -O3", the attached program generates
wrong output on x86_64 (both Linux and macOS). In particular, the rotated
sequence contains one of the items twice, and one item has disappeared.
I did some testing with the following outcomes:
- The code only fails in optimized mode
- The code only fails when using libc++, when compiling with the GCC 8
libstdc++, the generated code is correct
- On the other hand, when compiling the code with GCC 8 and libc++, the
generated code is also correct
- The code only fails when the output of std::min_element is used as the middle
parameter of std:rotate
--
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/20190207/57dea69c/attachment.html>
More information about the llvm-bugs
mailing list