Patchwork [3/11] Remove some dead code

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

Comments

Bernd Schmidt - July 1, 2011, 5:30 p.m.
A long time ago, this piece of code ended in a call to GEN_INT. Now that
we're using gen_int_mode, we needn't do the sign extension ourselves.


Bernd
* simplify-rtx.c (simplify_ternary_operation): Remove dead code.
Richard Henderson - July 5, 2011, 7:09 p.m.
On 07/01/2011 10:30 AM, Bernd Schmidt wrote:
> 	* simplify-rtx.c (simplify_ternary_operation): Remove dead code.
> 
> Index: baseline-trunk/gcc/simplify-rtx.c
> ===================================================================
> --- baseline-trunk.orig/gcc/simplify-rtx.c
> +++ baseline-trunk/gcc/simplify-rtx.c
> @@ -4948,15 +4948,6 @@ simplify_ternary_operation (enum rtx_cod
>  		val |= ~ (((unsigned HOST_WIDE_INT) 1 << INTVAL (op1)) - 1);
>  	    }
>  
> -	  /* Clear the bits that don't belong in our mode,
> -	     unless they and our sign bit are all one.
> -	     So we get either a reasonable negative value or a reasonable
> -	     unsigned value for this mode.  */
> -	  if (width < HOST_BITS_PER_WIDE_INT
> -	      && ((val & ((unsigned HOST_WIDE_INT) (-1) << (width - 1)))
> -		  != ((unsigned HOST_WIDE_INT) (-1) << (width - 1))))
> -	    val &= ((unsigned HOST_WIDE_INT) 1 << width) - 1;
> -
>  	  return gen_int_mode (val, mode);

Hah.  My question re patch 2.

Obviously ok.


r~

Patch

Index: baseline-trunk/gcc/simplify-rtx.c
===================================================================
--- baseline-trunk.orig/gcc/simplify-rtx.c
+++ baseline-trunk/gcc/simplify-rtx.c
@@ -4948,15 +4948,6 @@  simplify_ternary_operation (enum rtx_cod
 		val |= ~ (((unsigned HOST_WIDE_INT) 1 << INTVAL (op1)) - 1);
 	    }
 
-	  /* Clear the bits that don't belong in our mode,
-	     unless they and our sign bit are all one.
-	     So we get either a reasonable negative value or a reasonable
-	     unsigned value for this mode.  */
-	  if (width < HOST_BITS_PER_WIDE_INT
-	      && ((val & ((unsigned HOST_WIDE_INT) (-1) << (width - 1)))
-		  != ((unsigned HOST_WIDE_INT) (-1) << (width - 1))))
-	    val &= ((unsigned HOST_WIDE_INT) 1 << width) - 1;
-
 	  return gen_int_mode (val, mode);
 	}
       break;