From: Richard Henderson Date: Wed, 11 Aug 2004 04:00:04 +0000 (-0700) Subject: stor-layout.c (round_up): Check for 0/1 before dividing. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bf4ccdd6826b5f461cd8b90f5b9706d5d5c5616c;p=gcc.git stor-layout.c (round_up): Check for 0/1 before dividing. * stor-layout.c (round_up): Check for 0/1 before dividing. (round_down): Likewise. From-SVN: r85792 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0c7b2e7f934..a51da9b7310 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2004-08-10 Richard Henderson + * 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 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)) {