https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106755

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Peter Bergner from comment #2)
> That said, -Wall and -Wstrict-aliasing do not flag
> any warnings with the code.  I suppose they could miss some issues in the
> test case code???

typedef __vector unsigned int vui32_t;
...
typedef __vector unsigned __int128 vui128_t;
...

static inline vui128_t
vec_muludq (vui128_t *mulu, vui128_t a, vui128_t b)
{
...
  *mulu = (vui128_t) t;
...

int
test_muludq (void)
{
  vui32_t i, j, k, l /*, m*/;
....
  k = (vui32_t) test_vec_muludq((vui128_t* )&l, (vui128_t)i, (vui128_t)j);
....
  print_vint128_prod ("2**96-1 * 2**96-1 ", k, i, j, l);


So yes there is aliasing violation as you do the store as vui128_t aka
"__vector unsigned __int128" (which has the same aliasing set) as "__int128"
but then do the load from it as vui32_t aka "__vector unsigned int vui32_t"
(which is the same aliasing set as int). 

-Wstrict-aliasing=3 might warn about this case I can't remember exactly of the
levels of the options but the -Wstrict-aliasing warnings are always not going
to happen, sometimes it is easier to read the code.

Reply via email to