+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.
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
{
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
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 */
#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),
#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. */