This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [PATCH 5/7]: Ping3: Merge from Stack Branch - other ports


Revert this patch. Change to non-i386 ports is no longer needed.

Thanks - Joey 

-----Original Message-----
From: Ye, Joey 
Sent: Wednesday, May 28, 2008 5:00 PM
To: 'gcc-patches@gcc.gnu.org'
Cc: Lu, Hongjiu; Guo, Xuepeng; Ye, Joey
Subject: [PATCH 5/7]: Ping3: Merge from Stack Branch - other ports

OK to mainline?

2008-05-28  H.J. Lu  <hongjiu.lu@intel.com>

        * config/bfin/bfin.c (bfin_local_alignment): Use new
	LOCAL_ALIGNMENT macro.
        * config/bfin/bfin.h (LOCAL_ALIGNMENT): Likewise.
        * config/bfin/bfin-protos.h (bfin_local_alignment): Likewise.
        * config/i386/i386.h (LOCAL_ALIGNMENT): Likewise.
        * config/i386/i386-protos.h (ix86_local_alignment): Likewise.
        * config/mips/mips.h (LOCAL_ALIGNMENT): Likewise.
        * config/mmix/mmix.c (mmix_local_alignment): Likewise.
        * config/mmix/mmix.h (LOCAL_ALIGNMENT): Likewise.
        * config/mmix/mmix-protos.h (mmix_local_alignment): Likewise.
        * config/rs6000/rs6000.h (LOCAL_ALIGNMENT): Likewise.
        * config/score/score.h (LOCAL_ALIGNMENT): Likewise.
        * config/sh/sh.h (LOCAL_ALIGNMENT): Likewise.
        * config/sparc/sparc.h (LOCAL_ALIGNMENT): Likewise.
        * config/spu/spu.h (LOCAL_ALIGNMENT): Likewise.
        * config/rs6000/rs6000.h (LOCAL_ALIGNMENT_1): New.
        * config/sh/sh.h (LOCAL_ALIGNMENT_1): Likewise.
Index: config/spu/spu.h
===================================================================
--- config/spu/spu.h	(revision 136046)
+++ config/spu/spu.h	(working copy)
@@ -100,7 +100,8 @@ extern GTY(()) int spu_tune;
    unaligned.)  */
 #define DATA_ALIGNMENT(TYPE,ALIGN) ((ALIGN) > 128 ? (ALIGN) : 128)
 #define CONSTANT_ALIGNMENT(TYPE,ALIGN) ((ALIGN) > 128 ? (ALIGN) : 128)
-#define LOCAL_ALIGNMENT(TYPE,ALIGN) ((ALIGN) > 128 ? (ALIGN) : 128)
+#define LOCAL_ALIGNMENT(TYPE,MODE,ALIGN) \
+  ((!(TYPE) || (ALIGN) > 128) ? (ALIGN) : 128)
 
 #define EMPTY_FIELD_BOUNDARY 32
 
Index: config/sparc/sparc.h
===================================================================
--- config/sparc/sparc.h	(revision 136046)
+++ config/sparc/sparc.h	(working copy)
@@ -702,7 +702,8 @@ if (TARGET_ARCH64				\
    && (ALIGN) < FASTEST_ALIGNMENT ? FASTEST_ALIGNMENT : (ALIGN))
 
 /* Make local arrays of chars word-aligned for the same reasons.  */
-#define LOCAL_ALIGNMENT(TYPE, ALIGN) DATA_ALIGNMENT (TYPE, ALIGN)
+#define LOCAL_ALIGNMENT(TYPE, ALIGN) \
+  ((TYPE) ? DATA_ALIGNMENT (TYPE, ALIGN) : (ALIGN))
 
 /* Set this nonzero if move instructions will actually fail to work
    when given unaligned data.  */
Index: config/sh/sh.h
===================================================================
--- config/sh/sh.h	(revision 136046)
+++ config/sh/sh.h	(working copy)
@@ -854,11 +854,13 @@ do {
\
    held in a single integer register.  SH5 also holds CSImode and
SCmode
    values in integer registers.  This is relevant for argument passing
on
    SHcompact as we use a stack temp in order to pass CSImode by
reference.  */
-#define LOCAL_ALIGNMENT(TYPE, ALIGN) \
+#define LOCAL_ALIGNMENT_1(TYPE, ALIGN) \
   ((GET_MODE_CLASS (TYPE_MODE (TYPE)) == MODE_COMPLEX_INT \
     || GET_MODE_CLASS (TYPE_MODE (TYPE)) == MODE_COMPLEX_FLOAT) \
    ? (unsigned) MIN (BIGGEST_ALIGNMENT, GET_MODE_BITSIZE (TYPE_MODE
(TYPE))) \
    : (unsigned) DATA_ALIGNMENT(TYPE, ALIGN))
+#define LOCAL_ALIGNMENT(TYPE, MODE, ALIGN) \
+  ((TYPE) ? LOCAL_ALIGNMENT_1 (TYPE, ALIGN) : (ALIGN))
 
 /* Make arrays of chars word-aligned for the same reasons.  */
 #define DATA_ALIGNMENT(TYPE, ALIGN)		\
Index: config/rs6000/rs6000.h
===================================================================
--- config/rs6000/rs6000.h	(revision 136046)
+++ config/rs6000/rs6000.h	(working copy)
@@ -578,9 +578,9 @@ extern enum rs6000_nop_insertion rs6000_
 #define BIGGEST_ALIGNMENT 128
 
 /* A C expression to compute the alignment for a variables in the
-   local store.  TYPE is the data type, and ALIGN is the alignment
-   that the object would ordinarily have.  */
-#define LOCAL_ALIGNMENT(TYPE, ALIGN)				\
+   local store.  TYPE is the data type, MODE is the mode, and ALIGN
+   is the alignment that the object would ordinarily have.  */
+#define LOCAL_ALIGNMENT_1(TYPE, ALIGN)				\
   ((TARGET_ALTIVEC && TREE_CODE (TYPE) == VECTOR_TYPE) ? 128 :	\
     (TARGET_E500_DOUBLE
\
      && (TYPE_MODE (TYPE) == DFmode || TYPE_MODE (TYPE) == DDmode)) ?
64 : \
@@ -588,6 +588,8 @@ extern enum rs6000_nop_insertion rs6000_
      && SPE_VECTOR_MODE (TYPE_MODE (TYPE))) || (TARGET_PAIRED_FLOAT \
         && TREE_CODE (TYPE) == VECTOR_TYPE \
         && PAIRED_VECTOR_MODE (TYPE_MODE (TYPE)))) ? 64 : ALIGN)
+#define LOCAL_ALIGNMENT(TYPE, MODE, ALIGN)
\
+  ((TYPE) ? LOCAL_ALIGNMENT_1 (TYPE, ALIGN) : (ALIGN))
 
 /* Alignment of field after `int : 0' in a structure.  */
 #define EMPTY_FIELD_BOUNDARY 32
Index: config/score/score.h
===================================================================
--- config/score/score.h	(revision 136046)
+++ config/score/score.h	(working copy)
@@ -172,16 +172,20 @@
    && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))
 
 /* If defined, a C expression to compute the alignment for a local
-   variable.  TYPE is the data type, and ALIGN is the alignment that
-   the object would ordinarily have.  The value of this macro is used
-   instead of that alignment to align the object.
+   variable.  TYPE is the data type, MODE is the mode, and ALIGN is
+   the alignment that the object would ordinarily have.  The value of
+   this macro is used instead of that alignment to align the object.
+
+   If TYPE is NULL, we are allocating a stack slot for caller-save
+   register.  If MODE is VOIDmode, it is ignored.
 
    If this macro is not defined, then ALIGN is used.
 
    One use of this macro is to increase alignment of medium-size
    data to make it all fit in fewer cache lines.  */
-#define LOCAL_ALIGNMENT(TYPE, ALIGN)
\
-  ((TREE_CODE (TYPE) == ARRAY_TYPE
\
+#define LOCAL_ALIGNMENT(TYPE, MODE, ALIGN)
\
+  (((TYPE)
\
+    && TREE_CODE (TYPE) == ARRAY_TYPE
\
     && TYPE_MODE (TREE_TYPE (TYPE)) == QImode
\
     && (ALIGN) < BITS_PER_WORD) ? BITS_PER_WORD : (ALIGN))
 
Index: config/mips/mips.h
===================================================================
--- config/mips/mips.h	(revision 136046)
+++ config/mips/mips.h	(working copy)
@@ -1317,8 +1317,8 @@ enum mips_code_readable_setting {
    character arrays to be word-aligned so that `strcpy' calls that copy
    constants to character arrays can be done inline, and 'strcmp' can
be
    optimised to use word loads. */
-#define LOCAL_ALIGNMENT(TYPE, ALIGN) \
-  DATA_ALIGNMENT (TYPE, ALIGN)
+#define LOCAL_ALIGNMENT(TYPE, MODE, ALIGN) \
+  ((TYPE) ? DATA_ALIGNMENT ((TYPE), (ALIGN)) : (ALIGN))
   
 #define PAD_VARARGS_DOWN \
   (FUNCTION_ARG_PADDING (TYPE_MODE (type), type) == downward)
Index: config/mmix/mmix.h
===================================================================
--- config/mmix/mmix.h	(revision 136046)
+++ config/mmix/mmix.h	(working copy)
@@ -223,8 +223,8 @@ extern int target_flags;
 #define CONSTANT_ALIGNMENT(CONSTANT, BASIC_ALIGN) \
  mmix_constant_alignment (CONSTANT, BASIC_ALIGN)
 
-#define LOCAL_ALIGNMENT(TYPE, BASIC_ALIGN) \
- mmix_local_alignment (TYPE, BASIC_ALIGN)
+#define LOCAL_ALIGNMENT(TYPE, (MODE), BASIC_ALIGN) \
+ mmix_local_alignment (TYPE, (MODE), BASIC_ALIGN)
 
 /* Following other ports, this seems to most commonly be the word-size,
    so let's do that here too.  */
Index: config/mmix/mmix-protos.h
===================================================================
--- config/mmix/mmix-protos.h	(revision 136046)
+++ config/mmix/mmix-protos.h	(working copy)
@@ -58,7 +58,8 @@ extern rtx mmix_function_outgoing_value 
 extern int mmix_function_value_regno_p (int);
 extern int mmix_data_alignment (tree, int);
 extern int mmix_constant_alignment (tree, int);
-extern int mmix_local_alignment (tree, int);
+extern unsigned int mmix_local_alignment (tree, enum machine_mode mode,
+					  unsigned int);
 extern void mmix_asm_output_pool_prologue (FILE *, const char *, tree,
int);
 extern void mmix_asm_output_aligned_common (FILE *, const char *, int,
int);
 extern void mmix_asm_output_aligned_local (FILE *, const char *, int,
int);
Index: config/mmix/mmix.c
===================================================================
--- config/mmix/mmix.c	(revision 136046)
+++ config/mmix/mmix.c	(working copy)
@@ -271,10 +271,12 @@ mmix_constant_alignment (tree constant A
 
 /* LOCAL_ALIGNMENT.  */
 
-int
-mmix_local_alignment (tree type ATTRIBUTE_UNUSED, int basic_align)
+unsigned int
+mmix_local_alignment (tree type,
+		      enum machine_mode mode ATTRIBUTE_UNUSED,
+		      int basic_align)
 {
-  if (basic_align < 32)
+  if (type && basic_align < 32)
     return 32;
 
   return basic_align;
Index: config/bfin/bfin-protos.h
===================================================================
--- config/bfin/bfin-protos.h	(revision 136046)
+++ config/bfin/bfin-protos.h	(working copy)
@@ -120,7 +120,8 @@ extern void override_options (void);
 extern void asm_conditional_branch (rtx, rtx *, int, int);
 extern rtx bfin_gen_compare (rtx, Mmode);
 
-extern int bfin_local_alignment (tree, int);
+extern unsigned int bfin_local_alignment (tree, enum machine_mode,
+					  unsigned int);
 extern void initialize_trampoline (rtx, rtx, rtx);
 extern bool bfin_legitimate_address_p (Mmode, rtx, int);
 extern rtx bfin_va_arg (tree, tree);
Index: config/bfin/bfin.c
===================================================================
--- config/bfin/bfin.c	(revision 136046)
+++ config/bfin/bfin.c	(working copy)
@@ -3369,12 +3369,15 @@ bfin_expand_movmem (rtx dst, rtx src, rt
    the object would ordinarily have.  The value of this macro is used
    instead of that alignment to align the object.  */
 
-int
-bfin_local_alignment (tree type, int align)
+unsigned int
+bfin_local_alignment (tree type,
+		      enum machine_mode mode ATTRIBUTE_UNUSED,
+		      unsigned int align)
 {
   /* Increasing alignment for (relatively) big types allows the builtin
      memcpy can use 32 bit loads/stores.  */
-  if (TYPE_SIZE (type)
+  if (type
+      && TYPE_SIZE (type)
       && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
       && (TREE_INT_CST_LOW (TYPE_SIZE (type)) > 8
 	  || TREE_INT_CST_HIGH (TYPE_SIZE (type))) && align < 32)
Index: config/bfin/bfin.h
===================================================================
--- config/bfin/bfin.h	(revision 136046)
+++ config/bfin/bfin.h	(working copy)
@@ -303,16 +303,20 @@ extern const char *bfin_library_id_strin
 /*#define DATA_ALIGNMENT(TYPE, BASIC-ALIGN) for arrays.. */
 
 /* If defined, a C expression to compute the alignment for a local
-   variable.  TYPE is the data type, and ALIGN is the alignment that
-   the object would ordinarily have.  The value of this macro is used
-   instead of that alignment to align the object.
+   variable.  TYPE is the data type, MODE is the mode, and ALIGN is
+   the alignment that the object would ordinarily have.  The value of
+   this macro is used instead of that alignment to align the object.
+
+   If TYPE is NULL, we are allocating a stack slot for caller-save
+   register.  If MODE is VOIDmode, it is ignored.
 
    If this macro is not defined, then ALIGN is used.
 
    One use of this macro is to increase alignment of medium-size
    data to make it all fit in fewer cache lines.  */
 
-#define LOCAL_ALIGNMENT(TYPE, ALIGN) bfin_local_alignment ((TYPE),
(ALIGN))
+#define LOCAL_ALIGNMENT(TYPE, MODE, ALIGN) \
+  bfin_local_alignment ((TYPE), (MODE), (ALIGN))
 
 /* Make strings word-aligned so strcpy from constants will be faster.
*/
 #define CONSTANT_ALIGNMENT(EXP, ALIGN)  \


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]