re PR c/53037 (warn_if_not_aligned(X))
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 7 Nov 2017 17:37:29 +0000 (17:37 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 7 Nov 2017 17:37:29 +0000 (17:37 +0000)
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

gcc/ChangeLog
gcc/stor-layout.c

index 3af06775113c1d62db20c8c2bfa6ce3f490b19c9..27d52937dd8a279b60f2a01ae0598cff1032184f 100644 (file)
@@ -1,3 +1,10 @@
+2017-11-07  Eric Botcazou  <ebotcazou@adacore.com>
+
+       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.
+
 2017-11-07  Andrew Waterman  <andrew@sifive.com>
 
        * config/riscv/riscv-protos.h (riscv_hard_regno_nregs): New
index 02739b0ed7fd330fdf4f863b1836ebf8e0af8caf..7730ac33e4f62673f021ee95610c2e5e2e2843cb 100644 (file)
@@ -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;