aboutsummaryrefslogtreecommitdiff
path: root/gcc/stor-layout.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2017-11-07 17:37:29 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2017-11-07 17:37:29 +0000
commit02d7065ff47470c8f5229dafae4a25819aabe523 (patch)
tree3c3989b9bdd62e3c2ec08f995f5709cc0d8e4b38 /gcc/stor-layout.c
parent15ad44e7ecf1e18cd0a4801698ed2ee98f7028e6 (diff)
downloadgcc-02d7065ff47470c8f5229dafae4a25819aabe523.zip
gcc-02d7065ff47470c8f5229dafae4a25819aabe523.tar.gz
gcc-02d7065ff47470c8f5229dafae4a25819aabe523.tar.bz2
re PR c/53037 (warn_if_not_aligned(X))
PR c/53037 * stor-layout.c: Include attribs.h. (handle_warn_if_not_align): Replace test on TYPE_USER_ALIGN with explicit lookup of "aligned" attribute. From-SVN: r254503
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r--gcc/stor-layout.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 02739b0..7730ac3 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -40,6 +40,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-inline.h"
#include "dumpfile.h"
#include "gimplify.h"
+#include "attribs.h"
#include "debug.h"
/* Data type for the expressions representing sizes of data types.
@@ -1106,7 +1107,7 @@ handle_warn_if_not_align (tree field, unsigned int record_align)
if (!warn_if_not_align
&& warn_packed_not_aligned
- && TYPE_USER_ALIGN (type))
+ && lookup_attribute ("aligned", TYPE_ATTRIBUTES (type)))
{
warn_if_not_align = TYPE_ALIGN (type);
opt_w = OPT_Wpacked_not_aligned;