Patchwork [9/11] Fix units mismatch in comparison

login
register
mail settings
Submitter Bernd Schmidt
Date July 1, 2011, 5:38 p.m.
Message ID <4E0E060F.2030103@codesourcery.com>
Download mbox | patch
Permalink /patch/102938/
State New
Headers show

Comments

Bernd Schmidt - July 1, 2011, 5:38 p.m.
A bug fix discovered while working on the other patches. Previously,
this was a comparison of a GET_MODE_BITSIZE vs a GET_MODE_SIZE value.
After the other patches, it's GET_MODE_PRECISION vs GET_MODE_SIZE, which
is just as wrong, so change it.


Bernd
* rtlanal.c (nonzero_bits1): Don't compare GET_MODE_SIZE against
	a bitsize.
Richard Henderson - July 6, 2011, 6:25 p.m.
On 07/01/2011 10:38 AM, Bernd Schmidt wrote:
> 	* rtlanal.c (nonzero_bits1): Don't compare GET_MODE_SIZE against
> 	a bitsize.

Ok.


r~

Patch

Index: baseline-trunk/gcc/rtlanal.c
===================================================================
--- baseline-trunk.orig/gcc/rtlanal.c
+++ baseline-trunk/gcc/rtlanal.c
@@ -3993,7 +3993,7 @@  nonzero_bits1 (const_rtx x, enum machine
 	nonzero = 1;
 #endif
 
-      if (GET_MODE_SIZE (GET_MODE (x)) < mode_width)
+      if (GET_MODE_PRECISION (GET_MODE (x)) < mode_width)
 	nonzero |= (GET_MODE_MASK (mode) & ~GET_MODE_MASK (GET_MODE (x)));
       break;