]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
spu.c (TARGET_ENCODE_SECTION_INFO): Define.
authorUlrich Weigand <uweigand@de.ibm.com>
Tue, 12 Dec 2006 23:21:48 +0000 (23:21 +0000)
committerBen Elliston <bje@gcc.gnu.org>
Tue, 12 Dec 2006 23:21:48 +0000 (10:21 +1100)
* 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
gcc/config/spu/spu.c
gcc/config/spu/spu.h

index 0e5e595601dfcb8a34cf16b18e4b31dbb54d3c90..86530bca63ed328229bbd2de907bc6d455809ea5 100644 (file)
@@ -1,3 +1,10 @@
+2006-12-13  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * 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  <andrew_pinski@playstation.sony.com>
 
        PR tree-opt/28624
index 52c8e9ce9cb03d69c610eda55925949dd204ad03..7e3e687c7888b79802be4c0eefdf21fd4789f771 100644 (file)
@@ -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. 
index 923ca75ac7410db3280b5ddc28bd975e53353f8a..813bc6c039b57d4111ae01a765f96103a0e78f5e 100644 (file)
@@ -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))
 
@@ -372,6 +373,9 @@ warn_main = 0;                                                              \
 
 #define FUNCTION_VALUE_REGNO_P(N) ((N) >= (FIRST_RETURN_REGNUM) && (N) <= (LAST_RETURN_REGNUM))
 
+\f
+/* Machine-specific symbol_ref flags.  */
+#define SYMBOL_FLAG_ALIGN1     (SYMBOL_FLAG_MACH_DEP << 0)
 \f
 /* Aggregate Return */