Commit 8e66b377 by Richard Sandiford Committed by Richard Sandiford

[AArch64] Add an assert to aarch64_layout_frame

This patch adds an assert that all the individual *_adjust allocations
add up to the full frame size.  With that safety net, it seemed slightly
clearer to use crtl->outgoing_args_size as the final adjustment where
appropriate, to match what's used in the comments.

This is a bit overkill on its own, but I need to add more cases for SVE.

2019-10-16  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* config/aarch64/aarch64.c (aarch64_layout_frame): Assert
	that all the adjustments add up to the full frame size.
	Use crtl->outgoing_args_size directly as the final adjustment
	where appropriate.

From-SVN: r277060
parent ab43763e
2019-10-16 Richard Sandiford <richard.sandiford@arm.com> 2019-10-16 Richard Sandiford <richard.sandiford@arm.com>
* config/aarch64/aarch64.c (aarch64_layout_frame): Assert
that all the adjustments add up to the full frame size.
Use crtl->outgoing_args_size directly as the final adjustment
where appropriate.
2019-10-16 Richard Sandiford <richard.sandiford@arm.com>
* config/aarch64/aarch64.c (aarch64_layout_frame): Use a local * config/aarch64/aarch64.c (aarch64_layout_frame): Use a local
"frame" reference instead of always referring directly to "frame" reference instead of always referring directly to
"cfun->machine->frame". "cfun->machine->frame".
......
...@@ -5476,7 +5476,7 @@ aarch64_layout_frame (void) ...@@ -5476,7 +5476,7 @@ aarch64_layout_frame (void)
stp reg3, reg4, [sp, 16] stp reg3, reg4, [sp, 16]
sub sp, sp, outgoing_args_size */ sub sp, sp, outgoing_args_size */
frame.callee_adjust = const_fp_offset; frame.callee_adjust = const_fp_offset;
frame.final_adjust = frame.frame_size - frame.callee_adjust; frame.final_adjust = crtl->outgoing_args_size;
} }
else else
{ {
...@@ -5487,9 +5487,14 @@ aarch64_layout_frame (void) ...@@ -5487,9 +5487,14 @@ aarch64_layout_frame (void)
stp reg3, reg4, [sp, 16] stp reg3, reg4, [sp, 16]
sub sp, sp, outgoing_args_size */ sub sp, sp, outgoing_args_size */
frame.initial_adjust = frame.hard_fp_offset; frame.initial_adjust = frame.hard_fp_offset;
frame.final_adjust = frame.frame_size - frame.initial_adjust; frame.final_adjust = crtl->outgoing_args_size;
} }
/* Make sure the individual adjustments add up to the full frame size. */
gcc_assert (known_eq (frame.initial_adjust
+ frame.callee_adjust
+ frame.final_adjust, frame.frame_size));
frame.laid_out = true; frame.laid_out = true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment