Hi!

This testcase violates aliasing and so is "miscompiled" e.g. on powerpc64
or aarch64 at -O2.  Fixed thusly, tested on powerpc64-linux, committed to
trunk as obvious.

2019-01-16  Jakub Jelinek  <ja...@redhat.com>

        PR c/51628
        PR target/88682
        * c-c++-common/pr51628-10.c (unaligned_int128_t): Add
        may_alias attribute.

--- gcc/testsuite/c-c++-common/pr51628-10.c.jj  2018-12-21 00:40:49.048937834 
+0100
+++ gcc/testsuite/c-c++-common/pr51628-10.c     2019-01-16 15:15:51.515279138 
+0100
@@ -11,7 +11,7 @@ struct pair_t
 typedef struct unaligned_int128_t_
 {
   __int128_t value;
-} __attribute__((packed)) unaligned_int128_t;
+} __attribute__((packed, may_alias)) unaligned_int128_t;
 
 struct pair_t p = {0, 1};
 unaligned_int128_t *addr = (unaligned_int128_t *) &p.i;

        Jakub

Reply via email to