diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2005-11-09 23:28:59 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2005-11-09 23:28:59 +0000 |
commit | 9070115b6c6db4a9aba7745854cc37b15a88c601 (patch) | |
tree | e367222eea9195650865f1c41a955e732fbe405b /gcc/function.c | |
parent | 7e854c00d04f2279ac12fe76bcd9d62f0e800223 (diff) | |
download | gcc-9070115b6c6db4a9aba7745854cc37b15a88c601.zip gcc-9070115b6c6db4a9aba7745854cc37b15a88c601.tar.gz gcc-9070115b6c6db4a9aba7745854cc37b15a88c601.tar.bz2 |
function.c (assign_stack_local_1): Issue an error message if the frame size overflows in the signed target arithmetics.
* function.c (assign_stack_local_1): Issue an error message if
the frame size overflows in the signed target arithmetics.
From-SVN: r106717
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/function.c b/gcc/function.c index 9e36af7..963ad4f 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -479,6 +479,19 @@ assign_stack_local_1 (enum machine_mode mode, HOST_WIDE_INT size, int align, function->x_stack_slot_list = gen_rtx_EXPR_LIST (VOIDmode, x, function->x_stack_slot_list); + /* Try to detect frame size overflows. */ + if ((FRAME_GROWS_DOWNWARD + ? (unsigned HOST_WIDE_INT) -function->x_frame_offset + : (unsigned HOST_WIDE_INT) function->x_frame_offset) + > ((unsigned HOST_WIDE_INT) 1 << (BITS_PER_WORD - 1)) + /* Leave room for the fixed part of the frame. */ + - 64 * UNITS_PER_WORD) + { + error ("%Jtotal size of local objects too large", function->decl); + /* Avoid duplicate error messages as much as possible. */ + function->x_frame_offset = 0; + } + return x; } |