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, AArch64, Testsuite] Specify -fno-use-caller-save for func-ret* tests


Hi,

This patch resolves a conflict between the aapcs64 test framework for func-ret tests and the optimization option -fuse-caller-save, which was enabled by default at -O1 or above recently.

Basically, the test framework has an inline-assembly based mechanism in place which invokes the test facility function right on the return of a tested function. The compiler with -fuse-caller-save is unable to identify the unconventional call graph and carries out the optimization regardless.

Adding explicit LR clobbering field to the inline assembly doesn't solve the issue as the compiler would simply generate extra save/store of LR in the prologue/epilogue.

OK for the trunk?

Thanks,
Yufeng

gcc/testsuite/

	* gcc.target/aarch64/aapcs64/aapcs64.exp:
	(additional_flags_for_func_ret): New variable based on $additional_flags
	plus -fno-use-caller-save.
	(func-ret-*.c): Use the new variable.

Attachment: patch
Description: Text document


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