diff options
| -rw-r--r-- | gcc/ChangeLog | 3 | ||||
| -rw-r--r-- | gcc/stor-layout.c | 10 |
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0c7b2e7..a51da9b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2004-08-10 Richard Henderson <rth@redhat.com> + * stor-layout.c (round_up): Check for 0/1 before dividing. + (round_down): Likewise. + * tree-tailcall.c (suitable_for_tail_opt_p): Also check DECL_EXTERNAL. 2004-08-09 Mark Mitchell <mark@codesourcery.com> diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 7721770..3a0acd7 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)) { |
