[llvm] r284437 - Rename HexStyle -> HexFormatStyle, and remove a constexpr.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 18 23:08:09 PDT 2016


Would you mind trying the following patch (on top of the "broken" patch)
and then running SupportTests --gtest_filter=NativeFormatTest.*?

Then paste the output back here?  Here's my output for reference:

calling write_signed() with N == -10, sizeof(N) == 4
Unsigned value = 10
Using 32-bit codepath
write_unsigned_impl.  N = 10, IsNegative = 1
Prec = 1
format_to_buffer(10), BufferSize = 128
Wrote character 0
Wrote character 1
formatted value to buffer, Len = 2
LeadingZeros = 0
Writing negative sign
Writing 2 characters "10"
finished

If it is indeed an optimizer bug then perhaps the addition of this code
will cause it to start working.  Hopefully it yields a clue though.


On Tue, Oct 18, 2016 at 4:05 PM Zachary Turner <zturner at google.com> wrote:

> If this doesn't turn anything up, we can add some print statements to
> NativeFormatTest.cpp since debugging doesn't work well in an optimized
> build.
>
> For example, make a global variable in NativeFormatTest.cpp called
> g_print, initialize it to false, in write_signed when N == -10, set it to
> true, and when it's true you write a bunch of logging to stderr to trace
> the value through the various functions.
>
> On Tue, Oct 18, 2016 at 3:50 PM Zachary Turner <zturner at google.com> wrote:
>
> To get it to run under ubsan, I did the following.
>
> 1. clone compiler-rt into llvm/projects.
> 2. Build a stage 1 clang into A using -DCMAKE_BUILD_TYPE=Release
> 3. Build a stage 2 clang into B using -DCMAKE_BUILD_TYPE=Release
> -DCMAKE_C_COMPILER=A/bin/clang -DCMAKE_CXX_COMPILER=/A/bin/clang++
> -DLLVM_USE_SANITIZER=Undefined
> 4. ninja SupportTests
> 5. unittests/Support/SupportTests --gtest_filter=NativeFormatTest.*
>
> On Tue, Oct 18, 2016 at 3:46 PM Zachary Turner <zturner at google.com> wrote:
>
> I'm leaning towards bug in clang's optimizer.  I've scanned this code
> multiple times and I really don't see any UB.  I ran it under ubsan on
> Linux and it did not report any problems.
>
> I guess maybe you could run it under ubsan on aarch64 as well?
>
> Assuming that passes, where do we go from here?  I know 0 about the
> optimizer or how to fix a bug in it, especially one that only occurs in a
> backend I have no access to :-/
>
> On Tue, Oct 18, 2016 at 2:40 AM Renato Golin <renato.golin at linaro.org>
> wrote:
>
> On 18 October 2016 at 00:08, Zachary Turner via llvm-commits
> <llvm-commits at lists.llvm.org> wrote:
> > Author: zturner
> > Date: Mon Oct 17 18:08:47 2016
> > New Revision: 284437
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=284437&view=rev
> > Log:
> > Rename HexStyle -> HexFormatStyle, and remove a constexpr.
> >
> > This should fix the remaining broken builds.
>
> Hi Zach,
>
> Didn't quite fix all problems, but we're getting there... :)
>
> http://lab.llvm.org:8011/builders/clang-cmake-aarch64-full/builds/3344
>
> [ RUN      ] NativeFormatTest.IntegerTests
>
> /home/buildslave/buildslave/clang-cmake-aarch64-full/llvm/unittests/Support/NativeFormatTests.cpp:249:
> Failure
> Value of: format_number(-10, IntegerStyle::Integer, 1)
>   Actual: "-0"
> Expected: "-10"
> [  FAILED  ] NativeFormatTest.IntegerTests (0 ms)
>
> I have reverted on r284462. Let me know if you need help testing.
>
> cheers,
> --renato
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161019/6b339d47/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logging.patch
Type: application/octet-stream
Size: 4896 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161019/6b339d47/attachment-0001.obj>


More information about the llvm-commits mailing list