[patch] i386.c: Simplify an integer comparison.

Kazu Hirata kazu@cs.umass.edu
Fri Aug 22 14:45:00 GMT 2003


Hi,

Attached is a patch to simplify an integer comparison.

Tested on i686-pc-linux-gnu.  Committed as obvious.

Kazu Hirata

2003-08-22  Kazu Hirata  <kazu@cs.umass.edu>

	* config/i386/i386.c (const_int_1_operand): Simplify an
	integer comparison.

Index: i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.594
diff -u -r1.594 i386.c
--- i386.c	19 Aug 2003 17:17:27 -0000	1.594
+++ i386.c	22 Aug 2003 06:12:52 -0000
@@ -3343,7 +3343,7 @@
 int
 const_int_1_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
 {
-  return (GET_CODE (op) == CONST_INT && INTVAL (op) == 1);
+  return op == const1_rtx;
 }
 
 /* Return nonzero if OP is CONST_INT >= 1 and <= 31 (a valid operand



More information about the Gcc-patches mailing list