summaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorbje <bje@138bc75d-0d04-0410-961f-82ee72b054a4>2006-12-12 23:21:48 +0000
committerbje <bje@138bc75d-0d04-0410-961f-82ee72b054a4>2006-12-12 23:21:48 +0000
commit69ced2d614f1cc1763c130f9b39b72e802d33b2a (patch)
tree45ad7d40574a8bb0d19b828aad5c937a2fc8127d /gcc/config
parent76af66a672f65a028130f3eec695ba1f88e7c4ac (diff)
downloadgcc-69ced2d614f1cc1763c130f9b39b72e802d33b2a.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119803 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/spu/spu.c18
-rw-r--r--gcc/config/spu/spu.h4
2 files changed, 22 insertions, 0 deletions
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index 52c8e9ce9cb..7e3e687c788 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 923ca75ac74..813bc6c039b 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