From ae698e41edea77e25cb7e74ea60cd47de672a858 Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Sat, 27 Mar 1993 07:23:42 +0000 Subject: [PATCH] (stabilize_reference_1): For division and remainder, make a save_expr. From-SVN: r3889 --- gcc/tree.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gcc/tree.c b/gcc/tree.c index 9033cc5cc4e..0ce3ddb6cb7 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -1940,6 +1940,14 @@ stabilize_reference_1 (e) return e; case '2': + /* Division is slow and tends to be compiled with jumps, + especially the division by powers of 2 that is often + found inside of an array reference. So do it just once. */ + if (code == TRUNC_DIV_EXPR || code == TRUNC_MOD_EXPR + || code == FLOOR_DIV_EXPR || code == FLOOR_MOD_EXPR + || code == CEIL_DIV_EXPR || code == CEIL_MOD_EXPR + || code == ROUND_DIV_EXPR || code == ROUND_MOD_EXPR) + return save_expr (e); /* Recursively stabilize each operand. */ result = build_nt (code, stabilize_reference_1 (TREE_OPERAND (e, 0)), stabilize_reference_1 (TREE_OPERAND (e, 1))); -- 2.30.2