+2015-08-20 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
+
+ * defaults.h (CONSTANT_ALIGNMENT): New macro definition.
+ * builtins.c (get_object_alignment_2): Adjust.
+ * varasm.c (align_variable): Likewise.
+ (get_variable_align): Likewise.
+ (build_constant_desc): Likewise.
+ (force_const_mem): Likewise.
+ * doc/tm.texi.in: Likewise.
+ * doc/tm.texi: Regenerate.
+
2015-08-20 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* genconfig.c (main): Always define HAVE_cc0.
/* The alignment of a CONST_DECL is determined by its initializer. */
exp = DECL_INITIAL (exp);
align = TYPE_ALIGN (TREE_TYPE (exp));
-#ifdef CONSTANT_ALIGNMENT
if (CONSTANT_CLASS_P (exp))
align = (unsigned) CONSTANT_ALIGNMENT (exp, align);
-#endif
+
known_alignment = true;
}
else if (DECL_P (exp))
/* STRING_CST are the only constant objects we allow to be not
wrapped inside a CONST_DECL. */
align = TYPE_ALIGN (TREE_TYPE (exp));
-#ifdef CONSTANT_ALIGNMENT
if (CONSTANT_CLASS_P (exp))
align = (unsigned) CONSTANT_ALIGNMENT (exp, align);
-#endif
+
known_alignment = true;
}
#define WORD_REGISTER_OPERATIONS 0
#endif
+#ifndef CONSTANT_ALIGNMENT
+#define CONSTANT_ALIGNMENT(EXP, ALIGN) ALIGN
+#endif
+
#ifdef GCC_INSN_FLAGS_H
/* Dependent default target macro definitions
have. The value of this macro is used instead of that alignment to
align the object.
-If this macro is not defined, then @var{basic-align} is used.
+The default definition just returns @var{basic-align}.
The typical use of this macro is to increase alignment for string
constants to be word aligned so that @code{strcpy} calls that copy
have. The value of this macro is used instead of that alignment to
align the object.
-If this macro is not defined, then @var{basic-align} is used.
+The default definition just returns @var{basic-align}.
The typical use of this macro is to increase alignment for string
constants to be word aligned so that @code{strcpy} calls that copy
if (! DECL_THREAD_LOCAL_P (decl) || data_align <= BITS_PER_WORD)
align = data_align;
#endif
-#ifdef CONSTANT_ALIGNMENT
if (DECL_INITIAL (decl) != 0
/* In LTO we have no errors in program; error_mark_node is used
to mark offlined constructors. */
if (! DECL_THREAD_LOCAL_P (decl) || const_align <= BITS_PER_WORD)
align = const_align;
}
-#endif
}
}
if (! DECL_THREAD_LOCAL_P (decl) || data_align <= BITS_PER_WORD)
align = data_align;
#endif
-#ifdef CONSTANT_ALIGNMENT
if (DECL_INITIAL (decl) != 0
/* In LTO we have no errors in program; error_mark_node is used
to mark offlined constructors. */
if (! DECL_THREAD_LOCAL_P (decl) || const_align <= BITS_PER_WORD)
align = const_align;
}
-#endif
}
return align;
architectures so use DATA_ALIGNMENT as well, except for strings. */
if (TREE_CODE (exp) == STRING_CST)
{
-#ifdef CONSTANT_ALIGNMENT
DECL_ALIGN (decl) = CONSTANT_ALIGNMENT (exp, DECL_ALIGN (decl));
-#endif
}
else
align_variable (decl, 0);
/* Align the location counter as required by EXP's data type. */
align = GET_MODE_ALIGNMENT (mode == VOIDmode ? word_mode : mode);
-#ifdef CONSTANT_ALIGNMENT
- {
- tree type = lang_hooks.types.type_for_mode (mode, 0);
- if (type != NULL_TREE)
- align = CONSTANT_ALIGNMENT (make_tree (type, x), align);
- }
-#endif
+
+ tree type = lang_hooks.types.type_for_mode (mode, 0);
+ if (type != NULL_TREE)
+ align = CONSTANT_ALIGNMENT (make_tree (type, x), align);
pool->offset += (align / BITS_PER_UNIT) - 1;
pool->offset &= ~ ((align / BITS_PER_UNIT) - 1);