summaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorgeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-10 23:08:52 +0000
committergeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-10 23:08:52 +0000
commit097b5c8be3f2af3b4cbd88fe91d41719466375fb (patch)
tree4b25914785f1c180a9b1d207bac7c0dc0a43c6bb /gcc/varasm.c
parent169a293cb7a3a6de0ff347d9f19ff25e26c7fb2d (diff)
downloadgcc-097b5c8be3f2af3b4cbd88fe91d41719466375fb.tar.gz
2007-07-09 Geoffrey Keating <geoffk@apple.com>
PR 32617 * c-common.c (c_alignof_expr): Look at DECL_ALIGN of FUNCTION_DECLs. (handle_aligned_attribute): Allow use on FUNCTION_DECLs. * varasm.c (assemble_start_function): Honor DECL_ALIGN for FUNCTION_DECLs. Don't use align_functions_log if DECL_USER_ALIGN. * print-tree.c (print_node): Print DECL_ALIGN and DECL_USER_ALIGN even for FUNCTION_DECLs. * c-decl.c (merge_decls): Propagate DECL_ALIGN even for FUNCTION_DECLs. * tree.h (DECL_ALIGN): Update for new location of 'align'. (DECL_FUNCTION_CODE): Update for new location and name of 'function_code'. (DECL_OFFSET_ALIGN): Update for new location of 'off_align'. (struct tree_decl_common): Move 'align' and 'off_align' out of union, ensure they're still on a 32-bit boundary. Remove other fields in union 'u1'. (struct tree_function_decl): Add field 'function_code' replacing 'u1.f' in tree_decl_common. * tree.c (build_decl_stat): Set initial value of DECL_ALIGN. * doc/extend.texi (Function Attributes): Add 'aligned' attribute. (Variable Attributes): Cross-reference 'aligned' attribute to Function Attributes. * flags.h (force_align_functions_log): Delete. * toplev.c (force_align_functions_log): Delete. Index: gcc/testsuite/ChangeLog 2007-07-09 Geoffrey Keating <geoffk@apple.com> PR 32617 * gcc.c-torture/execute/align-3.c: New. Index: gcc/java/ChangeLog 2007-07-09 Geoffrey Keating <geoffk@apple.com> PR 32617 * lang.c (java_init): Remove setting of force_align_functions_log. * class.c (add_method_1): Set DECL_ALIGN of non-static method to cope with ptrmemfunc_vbit_in_pfn. Index: gcc/cp/ChangeLog 2007-07-09 Geoffrey Keating <geoffk@apple.com> PR 32617 * decl.c (cxx_init_decl_processing): Don't set force_align_functions_log. (grokfndecl): Honour ptrmemfunc_vbit_in_pfn. * typeck.c (cxx_alignof_expr): When alignof is used on a plain FUNCTION_DECL, return its alignment. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126529 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 511bf89e6ec..854a80df3c6 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1679,18 +1679,17 @@ assemble_start_function (tree decl, const char *fnname)
ASM_OUTPUT_LABEL (asm_out_file, cfun->hot_section_label);
/* Tell assembler to move to target machine's alignment for functions. */
- align = floor_log2 (FUNCTION_BOUNDARY / BITS_PER_UNIT);
- if (align < force_align_functions_log)
- align = force_align_functions_log;
+ align = floor_log2 (DECL_ALIGN (decl) / BITS_PER_UNIT);
if (align > 0)
{
ASM_OUTPUT_ALIGN (asm_out_file, align);
}
/* Handle a user-specified function alignment.
- Note that we still need to align to FUNCTION_BOUNDARY, as above,
+ Note that we still need to align to DECL_ALIGN, as above,
because ASM_OUTPUT_MAX_SKIP_ALIGN might not do any alignment at all. */
- if (align_functions_log > align
+ if (! DECL_USER_ALIGN (decl)
+ && align_functions_log > align
&& cfun->function_frequency != FUNCTION_FREQUENCY_UNLIKELY_EXECUTED)
{
#ifdef ASM_OUTPUT_MAX_SKIP_ALIGN