This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [llvm-dev] GCC 5 and -Wstrict-aliasing in JSON.h
On Fri, Aug 10, 2018 at 12:02 AM, Jonathan Wakely <jwakely.gcc@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