public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* HOST_WIDE_INT = long long patch
@ 1998-04-06 17:35 John Carr
  1998-04-07  6:54 ` Joern Rennecke
  1998-04-07 19:34 ` Jeffrey A Law
  0 siblings, 2 replies; 7+ messages in thread
From: John Carr @ 1998-04-06 17:35 UTC (permalink / raw)
  To: egcs

This fixes a bug in strength reduction on SPARC when HOST_WIDE_INT is
long long: multiplying by -1 gets the wrong answer.  It may not be the
best fix.  Please review.

Mon Apr  6 18:38:20 1998  John Carr  <jfc@mit.edu>

	* expmed.c (expand_mult): When HOST_WIDE_INT is wider than int do not
	call synth_mult with a negative multiplier value.

===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/expmed.c,v
retrieving revision 1.11
diff -c -3 -p -r1.11 expmed.c
*** expmed.c	1998/04/04 17:37:49	1.11
--- expmed.c	1998/04/06 22:37:43
*************** expand_mult (mode, op0, op1, target, uns
*** 2212,2218 ****
        mult_cost = rtx_cost (gen_rtx_MULT (mode, op0, op1), SET);
        mult_cost = MIN (12 * add_cost, mult_cost);
  
!       synth_mult (&alg, val, mult_cost);
  
        /* This works only if the inverted value actually fits in an
  	 `unsigned int' */
--- 2212,2221 ----
        mult_cost = rtx_cost (gen_rtx_MULT (mode, op0, op1), SET);
        mult_cost = MIN (12 * add_cost, mult_cost);
  
!       if (HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT || val >= 0)
! 	synth_mult (&alg, val, mult_cost);
!       else
! 	alg.cost = mult_cost;
  
        /* This works only if the inverted value actually fits in an
  	 `unsigned int' */

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~1998-04-08 21:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-04-06 17:35 HOST_WIDE_INT = long long patch John Carr
1998-04-07  6:54 ` Joern Rennecke
1998-04-07 19:34 ` Jeffrey A Law
1998-04-08  2:13   ` John Carr
1998-04-08  2:13     ` Jeffrey A Law
1998-04-08 13:11       ` Torbjorn Granlund
1998-04-08 21:20         ` Jeffrey A Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).