From e964d9b23ad7dc4878294d0119e676c43e1f1ea4 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 16 Jan 2019 15:18:47 +0100 Subject: [PATCH] re PR c/51628 (__attribute__((packed)) is unsafe in some cases (i.e. add -Waddress-of-packed-member, etc.)) 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 | 7 +++++++ gcc/testsuite/c-c++-common/pr51628-10.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f032b48a37e..d8f46a03378 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2019-01-16 Jakub Jelinek + + PR c/51628 + PR target/88682 + * c-c++-common/pr51628-10.c (unaligned_int128_t): Add + may_alias attribute. + 2019-01-15 Nikhil Benesch * gcc.misc-tests/godump-1.c: Add test case for typedef before diff --git a/gcc/testsuite/c-c++-common/pr51628-10.c b/gcc/testsuite/c-c++-common/pr51628-10.c index 085fe1608c4..a09f4ef4efa 100644 --- a/gcc/testsuite/c-c++-common/pr51628-10.c +++ b/gcc/testsuite/c-c++-common/pr51628-10.c @@ -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; -- 2.30.2