re PR c/51628 (__attribute__((packed)) is unsafe in some cases (i.e. add -Waddress...
authorJakub Jelinek <jakub@redhat.com>
Wed, 16 Jan 2019 14:18:47 +0000 (15:18 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 16 Jan 2019 14:18:47 +0000 (15:18 +0100)
PR c/51628
PR target/88682
* c-c++-common/pr51628-10.c (unaligned_int128_t): Add
may_alias attribute.

From-SVN: r267970

gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/pr51628-10.c

index f032b48a37e7a1e13780d758a8c196a166f24c18..d8f46a03378924be0b8acb1682c74ce26dade242 100644 (file)
@@ -1,3 +1,10 @@
+2019-01-16  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/51628
+       PR target/88682
+       * c-c++-common/pr51628-10.c (unaligned_int128_t): Add
+       may_alias attribute.
+
 2019-01-15  Nikhil Benesch  <nikhil.benesch@gmail.com>
 
         * gcc.misc-tests/godump-1.c: Add test case for typedef before
index 085fe1608c420a11ec1064e7409fe23290af38c0..a09f4ef4efab3916452084c73af8f0a6ed237fb2 100644 (file)
@@ -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;