From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Carr To: egcs@cygnus.com Subject: HOST_WIDE_INT = long long patch Date: Mon, 06 Apr 1998 17:35:00 -0000 Message-id: <199804062243.SAA04832@jfc.> X-SW-Source: 1998-04/msg00247.html 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 * 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' */