aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Pinski <andrew_pinski@playstation.sony.com>2007-10-17 21:12:50 +0000
committerAndrew Pinski <pinskia@gcc.gnu.org>2007-10-17 14:12:50 -0700
commitf8da819086c1b1b62df6e190a1f9948ec6c48846 (patch)
tree2e0f00841901d0b1941581550f65f5996aea9d71
parentfabf8971cfdddb7a27f2918d885e0ea49ac3bc5e (diff)
downloadgcc-f8da819086c1b1b62df6e190a1f9948ec6c48846.zip
gcc-f8da819086c1b1b62df6e190a1f9948ec6c48846.tar.gz
gcc-f8da819086c1b1b62df6e190a1f9948ec6c48846.tar.bz2
cfgexpand.c (expand_stack_vars): Add checking to make sure that the offset of a variable is not greater than the...
2007-10-17 Andrew Pinski <andrew_pinski@playstation.sony.com> * cfgexpand.c (expand_stack_vars): Add checking to make sure that the offset of a variable is not greater than the size of the paritition. From-SVN: r129420
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/cfgexpand.c7
2 files changed, 11 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9973adb..d0114fd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2007-10-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ * cfgexpand.c (expand_stack_vars): Add checking to make sure
+ that the offset of a variable is not greater than the size
+ of the paritition.
+
2007-10-17 Anatoly Sokolov <aesok@post.ru>
* config/avr/avr.c (avr_mcu_types): Add support for atmega48p,
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 769483b..0a4e2ca 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -579,8 +579,11 @@ expand_stack_vars (bool (*pred) (tree))
/* Create rtl for each variable based on their location within the
partition. */
for (j = i; j != EOC; j = stack_vars[j].next)
- expand_one_stack_var_at (stack_vars[j].decl,
- stack_vars[j].offset + offset);
+ {
+ gcc_assert (stack_vars[j].offset <= stack_vars[i].size);
+ expand_one_stack_var_at (stack_vars[j].decl,
+ stack_vars[j].offset + offset);
+ }
}
}