OSDN Git Service

* config/rs6000/rs6000.c (rs6000_xcoff_asm_named_section): Append
authordje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 11 Sep 2002 17:36:06 +0000 (17:36 +0000)
committerdje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 11 Sep 2002 17:36:06 +0000 (17:36 +0000)
alignment to csect.
(rs6000_xcoff_unique_section): Only set section name for public
data.
(rs6000_xcoff_section_type_flags): Store log2 alignment in flags.
* config/rs6000/xcoff.h (TARGET_ASM_SELECT_SECTION): Remove
duplicate definition.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57034 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/xcoff.h

index 14fa469..cab4f48 100644 (file)
@@ -1,3 +1,13 @@
+2002-09-11  David Edelsohn  <edelsohn@gnu.org>
+
+       * config/rs6000/rs6000.c (rs6000_xcoff_asm_named_section): Append
+       alignment to csect.
+       (rs6000_xcoff_unique_section): Only set section name for public
+       data.
+       (rs6000_xcoff_section_type_flags): Store log2 alignment in flags.
+       * config/rs6000/xcoff.h (TARGET_ASM_SELECT_SECTION): Remove
+       duplicate definition.
+
 2002-09-10  John David Anglin  <dave@hiauly1.hia.nrc.ca>
 
        * pa.md (extzv): Check predicates before emitting extzv_32.
index c6cf095..5974d3b 100644 (file)
@@ -13096,9 +13096,9 @@ rs6000_xcoff_asm_named_section (name, flags)
   else
     smclass = 1;
 
-  fprintf (asm_out_file, "\t.csect %s%s[%s]\n",
+  fprintf (asm_out_file, "\t.csect %s%s[%s],%u\n",
           (flags & SECTION_CODE) ? "." : "",
-          name, suffix[smclass]);
+          name, suffix[smclass], flags & SECTION_ENTSIZE);
 }
 
 static void
@@ -13130,8 +13130,9 @@ rs6000_xcoff_unique_section (decl, reloc)
 {
   const char *name;
 
-  /* Use select_section for uninitialized data.  */
-  if (DECL_COMMON (decl)
+  /* Use select_section for private and uninitialized data.  */
+  if (!TREE_PUBLIC (decl)
+      || DECL_COMMON (decl)
       || DECL_INITIAL (decl) == NULL_TREE
       || DECL_INITIAL (decl) == error_mark_node
       || (flag_zero_initialized_in_bss
@@ -13185,7 +13186,19 @@ rs6000_xcoff_section_type_flags (decl, name, reloc)
      const char *name;
      int reloc;
 {
-  return default_section_type_flags_1 (decl, name, reloc, 1);
+  unsigned int align;
+  unsigned int flags = default_section_type_flags_1 (decl, name, reloc, 1);
+
+  /* Align to at least UNIT size.  */
+  if (flags & SECTION_CODE)
+    align = MIN_UNITS_PER_WORD;
+  else
+    /* Increase alignment of large objects if not already stricter.  */
+    align = MAX ((DECL_ALIGN (decl) / BITS_PER_UNIT),
+                int_size_in_bytes (TREE_TYPE (decl)) > MIN_UNITS_PER_WORD
+                ? UNITS_PER_FP_WORD : MIN_UNITS_PER_WORD);
+
+  return flags | (exact_log2 (align) & SECTION_ENTSIZE);
 }
 
 #endif /* TARGET_XCOFF */
index dbe18ea..b83f678 100644 (file)
@@ -135,8 +135,6 @@ toc_section ()                                              \
 
 #define READONLY_DATA_SECTION read_only_data_section
 
-#define TARGET_ASM_SELECT_SECTION  rs6000_xcoff_select_section
-
 /* Return non-zero if this entry is to be written into the constant
    pool in a special way.  We do so if this is a SYMBOL_REF, LABEL_REF
    or a CONST containing one of them.  If -mfp-in-toc (the default),
@@ -166,8 +164,8 @@ toc_section ()                                              \
 #define TARGET_ASM_SELECT_SECTION  rs6000_xcoff_select_section
 #define TARGET_ASM_SELECT_RTX_SECTION  rs6000_xcoff_select_rtx_section
 #define TARGET_ASM_UNIQUE_SECTION  rs6000_xcoff_unique_section
-#define TARGET_ENCODE_SECTION_INFO rs6000_xcoff_encode_section_info
-#define TARGET_STRIP_NAME_ENCODING rs6000_xcoff_strip_name_encoding
+#define TARGET_ENCODE_SECTION_INFO  rs6000_xcoff_encode_section_info
+#define TARGET_STRIP_NAME_ENCODING  rs6000_xcoff_strip_name_encoding
 #define TARGET_SECTION_TYPE_FLAGS  rs6000_xcoff_section_type_flags
 
 /* FP save and restore routines.  */