From 3d9cd79a7c9c7d21e974ee10bf05fb356bafea32 Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Tue, 12 Dec 2006 23:21:48 +0000 Subject: [PATCH] spu.c (TARGET_ENCODE_SECTION_INFO): Define. * config/spu/spu.c (TARGET_ENCODE_SECTION_INFO): Define. (spu_encode_section_info): New. * config/spu/spu.h (ALIGNED_SYMBOL_REF_P): Adjust. (SYMBOL_FLAG_ALIGN1): New. From-SVN: r119803 --- gcc/ChangeLog | 7 +++++++ gcc/config/spu/spu.c | 18 ++++++++++++++++++ gcc/config/spu/spu.h | 4 ++++ 3 files changed, 29 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0e5e595..86530bc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2006-12-13 Ulrich Weigand + + * config/spu/spu.c (TARGET_ENCODE_SECTION_INFO): Define. + (spu_encode_section_info): New. + * config/spu/spu.h (ALIGNED_SYMBOL_REF_P): Adjust. + (SYMBOL_FLAG_ALIGN1): New. + 2006-12-12 Andrew Pinski PR tree-opt/28624 diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c index 52c8e9c..7e3e687 100644 --- a/gcc/config/spu/spu.c +++ b/gcc/config/spu/spu.c @@ -129,6 +129,7 @@ static unsigned char spu_function_ok_for_sibcall (tree decl, tree exp); static void spu_init_libfuncs (void); static bool spu_return_in_memory (tree type, tree fntype); static void fix_range (const char *); +static void spu_encode_section_info (tree, rtx, int); extern const char *reg_names[]; rtx spu_compare_op0, spu_compare_op1; @@ -244,6 +245,9 @@ const struct attribute_spec spu_attribute_table[]; #undef TARGET_RETURN_IN_MEMORY #define TARGET_RETURN_IN_MEMORY spu_return_in_memory +#undef TARGET_ENCODE_SECTION_INFO +#define TARGET_ENCODE_SECTION_INFO spu_encode_section_info + struct gcc_target targetm = TARGET_INITIALIZER; /* Sometimes certain combinations of command options do not make sense @@ -3178,6 +3182,20 @@ aligned_mem_p (rtx mem) return 0; } +/* Encode symbol attributes (local vs. global, tls model) of a SYMBOL_REF + into its SYMBOL_REF_FLAGS. */ +static void +spu_encode_section_info (tree decl, rtx rtl, int first) +{ + default_encode_section_info (decl, rtl, first); + + /* If a variable has a forced alignment to < 16 bytes, mark it with + SYMBOL_FLAG_ALIGN1. */ + if (TREE_CODE (decl) == VAR_DECL + && DECL_USER_ALIGN (decl) && DECL_ALIGN (decl) < 128) + SYMBOL_REF_FLAGS (XEXP (rtl, 0)) |= SYMBOL_FLAG_ALIGN1; +} + /* Return TRUE if we are certain the mem refers to a complete object which is both 16-byte aligned and padded to a 16-byte boundary. This would make it safe to store with a single instruction. diff --git a/gcc/config/spu/spu.h b/gcc/config/spu/spu.h index 923ca75..813bc6c 100644 --- a/gcc/config/spu/spu.h +++ b/gcc/config/spu/spu.h @@ -87,6 +87,7 @@ extern const char *spu_fixed_range_string; /* symbol_ref's of functions are not aligned to 16 byte boundary. */ #define ALIGNED_SYMBOL_REF_P(X) \ (GET_CODE (X) == SYMBOL_REF \ + && (SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_ALIGN1) == 0 \ && (! SYMBOL_REF_FUNCTION_P (X) \ || align_functions >= 16)) @@ -373,6 +374,9 @@ warn_main = 0; \ #define FUNCTION_VALUE_REGNO_P(N) ((N) >= (FIRST_RETURN_REGNUM) && (N) <= (LAST_RETURN_REGNUM)) +/* Machine-specific symbol_ref flags. */ +#define SYMBOL_FLAG_ALIGN1 (SYMBOL_FLAG_MACH_DEP << 0) + /* Aggregate Return */ #define DEFAULT_PCC_STRUCT_RETURN 0 -- 2.7.4