[llvm-bugs] [Bug 28551] Regression(r275401): assert while building ffmpeg

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jul 14 10:06:27 PDT 2016


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

Sebastian Pop <sebpop at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #9 from Sebastian Pop <sebpop at gmail.com> ---
Which explains the crashes all over the place: the std::sort of today's libcxx
is inefficient as it calls the compare function on the same element:

            // known that *(__i - 1) < *__m
            // known that __i <= __m
            while (true)
            {
                // __m still guards upward moving __i
                while (__comp(*__i, *__m))
                    ++__i;
                // It is now known that a guard exists for downward moving __j
                while (!__comp(*--__j, *__m))
                    ;
                if (__i > __j)
                    break;
                swap(*__i, *__j);
                ++__n_swaps;
                // It is known that __m != __j
                // If __m just moved, follow it
                if (__m == __i)
                    __m = __j;
                ++__i;
            }

In particular this "if (__m == __i)" should be above the first call to
__comp().
Maybe some other places.

As the buildbots are not bootstrapping their libc++, there is not much I can do
to avoid all the users of Apple toolchains to see the assert failing.

I will remove the assert that I have in the GVNHoist code, and open a libcxx
bug for inefficiencies in the std::sort() algorithm.

-- 
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/20160714/b334fb8d/attachment.html>


More information about the llvm-bugs mailing list