This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
This was fun to track down
- To: egcs at cygnus dot com
- Subject: This was fun to track down
- From: "David S. Miller" <davem at jenolan dot rutgers dot edu>
- Date: Mon, 22 Sep 1997 22:36:55 -0400
Mon Sep 22 22:18:48 1997 David S. Miller <davem@tanya.rutgers.edu>
* expmed.c (expand_divmod): If compute_mode is not the same as
mode, handle the case where convert_modes() causes op1 to no
longer be a CONST_INT.
--- expmed.c.~1~ Sun Sep 7 18:10:31 1997
+++ expmed.c Mon Sep 22 22:18:27 1997
@@ -2831,6 +2831,14 @@
{
op0 = convert_modes (compute_mode, mode, op0, unsignedp);
op1 = convert_modes (compute_mode, mode, op1, unsignedp);
+
+ /* convert_modes() may have tossed op1 into a register, so we
+ absolutely must recompute the following. */
+ op1_is_constant = GET_CODE (op1) == CONST_INT;
+ op1_is_pow2 = (op1_is_constant
+ && ((EXACT_POWER_OF_2_OR_ZERO_P (INTVAL (op1))
+ || (! unsignedp
+ && EXACT_POWER_OF_2_OR_ZERO_P (-INTVAL (op1))))));
}
/* If one of the operands is a volatile MEM, copy it into a register. */