[llvm-dev] GCC 5 and -Wstrict-aliasing in JSON.h
Kim Gräsman via llvm-dev
llvm-dev at lists.llvm.org
Thu Aug 9 15:20:27 PDT 2018
On Fri, Aug 10, 2018 at 12:02 AM, Jonathan Wakely <jwakely.gcc at gmail.com>
wrote:
>
> If GCC 4.9.3 thinks there's an aliasing violation it might
> misoptimise. It doesn't matter if it's right or not, it matters if it
> treats the code as undefined or not.
>
> And apparently GCC does think there's a violation, because it warns.
>
> Unless you're sure that not only is the code OK, but GCC is just being
> noisy and doesn't misoptimise, then I think using -fno-strict-aliasing
> is safer than just suppressing the warning.
Good point, I can see how that would play out nicer.
So this would probably need to be addressed in the LLVM build system, I'll
try and work up a patch tomorrow.
Thanks,
- Kim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180810/3ae4272a/attachment.html>
More information about the llvm-dev
mailing list