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]

[PATCH] fix hardcoded rs6000-xcoff csects alignment


Hello,

rs6000-xcoff ports use hardcoded alignment factors for control
sections in a number of places, intended to match what BIGGEST_ALIGNMENT
allows.

BIGGEST_ALIGNMENT was bumped to 16bytes some time ago and the csect
alignments remained untouched, typically:

   xcoff.h
   ...
   /* Output before writable data.
      Align entire section to BIGGEST_ALIGNMENT.  */
   #define DATA_SECTION_ASM_OP "\t.csect .data[RW],3"
                                                  ^^^ 8bytes align

Attached is a patch to fix this together with a simple Ada testcase
(runs fine with the patch, raise Program_Error otherwise).

The patch was bootstrapped and regtested on powerpc-ibm-aix5.3.0.0.

Thanks in advance,

Olivier


2007-06-18  Olivier Hainque  <hainque@adacore.com>

	* config/rs6000/xcoff.h (XCOFF_CSECT_DEFAULT_ALIGNMENT_STR): New
	internal macro. Default alignment factor for csect directives, chosen
	to match what BIGGEST_ALIGNMENT allows.
	(DATA_SECTION_ASM_OP): Use it.
	* config/rs6000/rs6000.c (rs6000_xcoff_output_readonly_section_asm_op):
	Use XCOFF_CSECT_DEFAULT_ALIGNMENT_STR.
	(rs6000_xcoff_output_readwrite_section_asm_op): Likewise.
	(rs6000_xcoff_output_toc_section_asm_op): Likewise.

	testsuite/
	* gnat.dg/test_oalign.adb: New test.
	* gnat.dg/oalign1.ads: Part of new test.
	* gnat.dg/oalign2.ads: Part of new test.









Attachment: csects-align.dif
Description: Text document


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