head	1.2;
access;
symbols
	RELEASE_7_1_0:1.1
	RELEASE_6_4_0:1.1
	RELEASE_5_EOL:1.1
	RELEASE_7_0_0:1.1
	RELEASE_6_3_0:1.1
	PRE_XORG_7:1.1
	RELEASE_4_EOL:1.1
	RELEASE_6_2_0:1.1
	RELEASE_6_1_0:1.1
	RELEASE_5_5_0:1.1
	RELEASE_6_0_0:1.1
	RELEASE_5_4_0:1.1
	RELEASE_4_11_0:1.1
	RELEASE_5_3_0:1.1
	RELEASE_4_10_0:1.1
	RELEASE_5_2_1:1.1
	RELEASE_5_2_0:1.1
	RELEASE_4_9_0:1.1
	RELEASE_5_1_0:1.1
	RELEASE_4_8_0:1.1
	RELEASE_5_0_0:1.1
	RELEASE_4_7_0:1.1
	RELEASE_4_6_2:1.1
	RELEASE_4_6_1:1.1
	RELEASE_4_6_0:1.1
	RELEASE_5_0_DP1:1.1
	RELEASE_4_5_0:1.1
	RELEASE_4_4_0:1.1
	RELEASE_4_3_0:1.1
	RELEASE_4_2_0:1.1
	RELEASE_4_1_1:1.1
	RELEASE_4_1_0:1.1
	RELEASE_3_5_0:1.1
	RELEASE_4_0_0:1.1
	RELEASE_3_4_0:1.1
	RELEASE_3_3_0:1.1
	RELEASE_3_2_0:1.1
	RELEASE_3_1_0:1.1
	RELEASE_2_2_8:1.1
	RELEASE_3_0_0:1.1;
locks; strict;
comment	@# @;


1.2
date	2009.01.24.12.17.08;	author gerald;	state dead;
branches;
next	1.1;

1.1
date	98.08.14.09.20.23;	author obrien;	state Exp;
branches;
next	;


desc
@@


1.2
log
@Remove lang/gcc28 (GCC 2.8) which has been DEPRECATED for more than
3 years and does not build anywhere.

No objections:	mjl@@luckie.org.nz (maintainer), pav
@
text
@--- expmed.c.dist	Sat Nov  8 14:11:58 1997
+++ expmed.c	Thu Aug 13 11:18:13 1998
@@@@ -2249,7 +2249,8 @@@@
 	      rtx shift_subtarget = preserve ? 0 : accum;
 	      rtx add_target
 		= (opno == alg.ops - 1 && target != 0 && variant != add_variant
-		  ? target : 0);
+		   && ! preserve)
+		  ? target : 0;
 	      rtx accum_target = preserve ? 0 : accum;
 	      
 	      switch (alg.op[opno])
@@@@ -2716,6 +2717,7 @@@@
   optab optab1, optab2;
   int op1_is_constant, op1_is_pow2;
   int max_cost, extra_cost;
+  static HOST_WIDE_INT last_div_const = 0;
 
   op1_is_constant = GET_CODE (op1) == CONST_INT;
   op1_is_pow2 = (op1_is_constant
@@@@ -2825,8 +2827,15 @@@@
   size = GET_MODE_BITSIZE (mode);
 #endif
 
+  /* Only deduct something for a REM if the last divide done was
+     for a different constant.   Then set the constant of the last
+     divide.  */
   max_cost = div_cost[(int) compute_mode]
-    - (rem_flag ? mul_cost[(int) compute_mode] + add_cost : 0);
+    - (rem_flag && ! (last_div_const != 0 && op1_is_constant
+		      && INTVAL (op1) == last_div_const)
+       ? mul_cost[(int) compute_mode] + add_cost : 0);
+
+  last_div_const = ! rem_flag && op1_is_constant ? INTVAL (op1) : 0;
 
   /* Now convert to the best mode to use.  */
   if (compute_mode != mode)
@


1.1
log
@* expmed.c (expand_mult): Use 0 as add_target if should preserve
        subexpressions.
* expmed.c (expand_divmod): Save last divison constant and
        if rem is same as div, don't adjust rem cost.

Submitted by:	Peter Jeremy <peter.jeremy@@auss2.alcatel.com.au>
@
text
@@

