diff mbox

[committed] Remove a cast in cse.c

Message ID 1409880686.19403.43.camel@surprise
State New
Headers show

Commit Message

David Malcolm Sept. 5, 2014, 1:31 a.m. UTC
The attached trivial patch strengthens a local variable in cse.c from
rtx to rtx_insn *, allowing the elimination of a checked cast, and thus
falls under the pre-approval granted by Jeff here:
  https://gcc.gnu.org/ml/gcc-patches/2014-08/msg01310.html

Bootstrapped on x86_64-unknown-linux-gnu (Fedora 20), and has been
rebuilt as part of a config-list.mk build for all working configurations
(albeit with other patches for the latter case).

Committed to trunk as r214932.
diff mbox

Patch

Index: gcc/ChangeLog
===================================================================
--- gcc/ChangeLog	(revision 214931)
+++ gcc/ChangeLog	(revision 214932)
@@ -1,5 +1,10 @@ 
 2014-09-05  David Malcolm  <dmalcolm@redhat.com>
 
+	* cse.c (cse_insn): Strengthen local "new_rtx" from rtx to
+	rtx_insn *, eliminating a checked cast.
+
+2014-09-05  David Malcolm  <dmalcolm@redhat.com>
+
 	* rtl.h (modified_between_p): Strengthen params 2 and 3 from
 	const_rtx to const rtx_insn *.
 	* rtlanal.c (modified_between_p): Likewise, eliminating a checked
Index: gcc/cse.c
===================================================================
--- gcc/cse.c	(revision 214931)
+++ gcc/cse.c	(revision 214932)
@@ -5435,7 +5435,8 @@ 
 	     and hope for the best.  */
 	  if (n_sets == 1)
 	    {
-	      rtx new_rtx, note;
+	      rtx_insn *new_rtx;
+	      rtx note;
 
 	      new_rtx = emit_jump_insn_before (gen_jump (XEXP (src, 0)), insn);
 	      JUMP_LABEL (new_rtx) = XEXP (src, 0);
@@ -5450,7 +5451,7 @@ 
 		}
 
 	      delete_insn_and_edges (insn);
-	      insn = as_a <rtx_insn *> (new_rtx);
+	      insn = new_rtx;
 	    }
 	  else
 	    INSN_CODE (insn) = -1;