Hi all,
This patch fixes the regression to gcc.dg/rtl/aarch64/subs_adds_sp.c that
r271735 caused. This was done by ensuring that the current function's
frame has
been laid out before checking if return address signing is enabled.
Tested and built on aarch64-none-elf and aarch64-none-linux-gnu.
OK for trunk?
Sam Tebbs
gcc/
2019-06-20 Sam Tebbs<[email protected]>
PR target/90712
* aarch64/aarch64.c (aarch64_post_cfi_startproc): Replace thunk check
with a frame laid out check.
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index f8285ac5fac61a4d94008847c1b3e0d2ac79c33b..9f7365a1a324cbeb6ab19e2f133b3cc2ba0ede54 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -15702,7 +15702,7 @@ aarch64_asm_output_external (FILE *stream, tree decl, const char* name)
void
aarch64_post_cfi_startproc (FILE *f, tree ignored ATTRIBUTE_UNUSED)
{
- if (!cfun->is_thunk && aarch64_return_address_signing_enabled ()
+ if (cfun->machine->frame.laid_out && aarch64_return_address_signing_enabled ()
&& aarch64_ra_sign_key == AARCH64_KEY_B)
asm_fprintf (f, "\t.cfi_b_key_frame\n");
}