From f9d4d3cf937b5a94d461a51799018dfb33262650 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Tue, 11 Dec 2018 15:03:29 +0000 Subject: [PATCH] Fix stack offsets and alloca alignments on ppc-vxworks * config/rs6000/vxworks.h (RS6000_STARTING_FRAME_OFFSET): Define, accounting for STACK_BOUNDARY 128 regardless of TARGET_ALTIVEC/VSX. (STACK_DYNAMIC_OFFSET): Likewise. From-SVN: r267024 --- gcc/ChangeLog | 6 ++++++ gcc/config/rs6000/vxworks.h | 13 ++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 31cafdca13e..99ba8bdd7fa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-12-11 Eric Botcazou + + * config/rs6000/vxworks.h (RS6000_STARTING_FRAME_OFFSET): Define, + accounting for STACK_BOUNDARY 128. + (STACK_DYNAMIC_OFFSET): Likewise. + 2018-12-11 Jakub Jelinek PR target/88425 diff --git a/gcc/config/rs6000/vxworks.h b/gcc/config/rs6000/vxworks.h index d2033f60c22..49686433b87 100644 --- a/gcc/config/rs6000/vxworks.h +++ b/gcc/config/rs6000/vxworks.h @@ -116,7 +116,7 @@ VXWORKS_ADDITIONAL_CPP_SPEC #undef SDATA_DEFAULT_SIZE #define SDATA_DEFAULT_SIZE (TARGET_VXWORKS_RTP ? 8 : 0) -/* Enforce 16bytes alignment for the stack pointer, to permit general +/* Enforce 16-byte alignment for the stack pointer, to permit general compliance with e.g. Altivec instructions requirements. Make sure this isn't overruled by the EABI constraints. */ @@ -128,6 +128,17 @@ VXWORKS_ADDITIONAL_CPP_SPEC #undef ABI_STACK_BOUNDARY +#undef RS6000_STARTING_FRAME_OFFSET +#define RS6000_STARTING_FRAME_OFFSET \ + (cfun->calls_alloca \ + ? RS6000_ALIGN (crtl->outgoing_args_size + RS6000_SAVE_AREA, 16) \ + : (RS6000_ALIGN (crtl->outgoing_args_size, 16) + RS6000_SAVE_AREA)) + +#undef STACK_DYNAMIC_OFFSET +#define STACK_DYNAMIC_OFFSET(FUNDECL) \ + RS6000_ALIGN (crtl->outgoing_args_size.to_constant () \ + + STACK_POINTER_OFFSET, 16) + #undef SUBSUBTARGET_OVERRIDE_OPTIONS #define SUBSUBTARGET_OVERRIDE_OPTIONS \ do { \ -- 2.30.2