This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Prevent use of DECL_ALIGN on a FUNCTION_DECL
- From: gkeating at apple dot com (Geoffrey Keating)
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 3 Jul 2007 12:12:23 -0700 (PDT)
- Subject: Prevent use of DECL_ALIGN on a FUNCTION_DECL
FUNCTION_DECLs don't have a DECL_ALIGN, the other fields in the u1
union are used; this patch makes tree-checking catch that case.
Bootstrapped & tested on powerpc-darwin8.
--
- Geoffrey Keating <geoffk@apple.com>
===File ~/patches/gcc-nofuncdeclalign.patch=================
2007-07-03 Geoffrey Keating <geoffk@apple.com>
* tree.h (DECL_ALIGN): Prevent use on a FUNCTION_DECL.
Index: gcc/tree.h
===================================================================
--- gcc/tree.h (revision 125926)
+++ gcc/tree.h (working copy)
@@ -2580,7 +2580,7 @@
/* Likewise for the size in bytes. */
#define DECL_SIZE_UNIT(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.size_unit)
/* Holds the alignment required for the datum, in bits. */
-#define DECL_ALIGN(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.u1.a.align)
+#define DECL_ALIGN(NODE) (TREE_NOT_CHECK (DECL_COMMON_CHECK (NODE), FUNCTION_DECL)->decl_common.u1.a.align)
/* The alignment of NODE, in bytes. */
#define DECL_ALIGN_UNIT(NODE) (DECL_ALIGN (NODE) / BITS_PER_UNIT)
/* For FIELD_DECLs, off_align holds the number of low-order bits of
============================================================