summaryrefslogtreecommitdiff
path: root/gcc/stor-layout.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r--gcc/stor-layout.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 772177077f2..3a0acd70725 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -277,6 +277,11 @@ round_up (tree value, int divisor)
{
tree t;
+ if (divisor == 0)
+ abort ();
+ if (divisor == 1)
+ return value;
+
/* If divisor is a power of two, simplify this to bit manipulation. */
if (divisor == (divisor & -divisor))
{
@@ -302,6 +307,11 @@ round_down (tree value, int divisor)
{
tree t;
+ if (divisor == 0)
+ abort ();
+ if (divisor == 1)
+ return value;
+
/* If divisor is a power of two, simplify this to bit manipulation. */
if (divisor == (divisor & -divisor))
{