This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch][i386] PR 70118: Fix ubsan warning on SSE2 loadl_epi64 and storel_epi64


On Sat, 26 Nov 2016, Allan Sandfeld Jensen wrote:

Use the recently introduced unaligned variant of __m128i and add a similar
__m64 and use those to make it clear these two intrinsics require neither 128-
bit nor 64-bit alignment.

Thanks for doing this. You'll want Uros or Kirill to review your patch.
There are probably several more places that could do with an unaligned fix, but we don't have to find them all at once. First I found it strange to use __m64, but then it actually seems like a good call to use a type that is not just aligned(1) but also may_alias.

+  *(__m64_u *)__P = __m64(((__v2di)__B)[0]);

gcc complains about this syntax for me, it wants parentheses around __m64... Did it pass the testsuite for you?
On the other hand, this seems less complicated:

  *(__m64_u *)__P = *(__m64*)&__B;

I am now wondering if we are not using the __v2di-like types too much, in places where the lack of may_alias might be an issue... Or maybe I am afraid for no reason and even here the may_alias is unnecessary. Looking at dumps also makes me wonder if we could simplify view_convert_expr(bit_field_expr) to just bit_field_expr when it is the only use.

--
Marc Glisse


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]