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]

[Ada] Request stack pointer realignment on foreign convention


Alignment requests in Ada must be honored when they are accepted and
this currently relies on the force_align_arg_pointer attribute
circuitry for stack objects on x86 like targets.

While this automatically applies to the "main" entry point, we also
need the adjustment on every other possible access point back from the
environment, such as thread main routines.

This patch implements this by attaching the attribute to the relevant
subprograms, identified as those with a foreign convention.

Bootstrapped and regtested on i686-pc-linux-gnu and x86_64-suse-linux.

2008-06-13  Olivier Hainque  <hainque@adacore.com>

	ada/
	* decl.c (FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN): Define to 0
	if undefined.
	(gnat_to_gnu_entity) <case E_Function/Procedure>: Request stack
	realignment with force_align_arg_pointer attribute on foreign
	convention subprograms if FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN.

	testsuite/
	* gnat.dg/task_stack_align.adb: New test.

Attachment: ada-stack-realign.dif
Description: Text document


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