summaryrefslogtreecommitdiffstats
path: root/gcc/explow.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1994-07-12 13:07:53 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1994-07-12 13:07:53 +0000
commit8c08cc16ce2518fcfd098d4d56999b1016b3ca89 (patch)
treeb141017cc7e4e08595acc02a21363e06ccddd0ee /gcc/explow.c
parent15a3d64255db2c908591562f4bdf8144c98567cb (diff)
downloadppe42-gcc-8c08cc16ce2518fcfd098d4d56999b1016b3ca89.tar.gz
ppe42-gcc-8c08cc16ce2518fcfd098d4d56999b1016b3ca89.zip
(round_push, allocate_dynamic_stack_space): Avoid using CEIL_DIV_EXPR;
add adjustment and use TRUNC_DIV_EXPR instead. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@7738 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/explow.c')
-rw-r--r--gcc/explow.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/explow.c b/gcc/explow.c
index 7f1e196e5a8..0d2445359c4 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -742,7 +742,11 @@ round_push (size)
}
else
{
- size = expand_divmod (0, CEIL_DIV_EXPR, Pmode, size, GEN_INT (align),
+ /* CEIL_DIV_EXPR needs to worry about the addition overflowing,
+ but we know it can't. So add ourselves and then do TRUNC_DIV_EXPR. */
+ size = expand_binop (Pmode, add_optab, size, GEN_INT (align - 1),
+ NULL_RTX, 1, OPTAB_LIB_WIDEN);
+ size = expand_divmod (0, TRUNC_DIV_EXPR, Pmode, size, GEN_INT (align),
NULL_RTX, 1);
size = expand_mult (Pmode, size, GEN_INT (align), NULL_RTX, 1);
}
@@ -1053,10 +1057,14 @@ allocate_dynamic_stack_space (size, target, known_align)
if (known_align % BIGGEST_ALIGNMENT != 0)
#endif
{
- target = expand_divmod (0, CEIL_DIV_EXPR, Pmode, target,
+ /* CEIL_DIV_EXPR needs to worry about the addition overflowing,
+ but we know it can't. So add ourselves and then do TRUNC_DIV_EXPR. */
+ target = expand_binop (Pmode, add_opatab, target,
+ GEN_INT (BIGGEST_ALIGNMENT / BITS_PER_UNIT - 1),
+ NULL_RTX, 1, OPTAB_LIB_WIDEN);
+ target = expand_divmod (0, TRUNC_DIV_EXPR, Pmode, target,
GEN_INT (BIGGEST_ALIGNMENT / BITS_PER_UNIT),
NULL_RTX, 1);
-
target = expand_mult (Pmode, target,
GEN_INT (BIGGEST_ALIGNMENT / BITS_PER_UNIT),
NULL_RTX, 1);
OpenPOWER on IntegriCloud