From 8fe1d91f6283e706734fd2783fa98ec4e32623c9 Mon Sep 17 00:00:00 2001
From: naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
Date: Wed, 29 Jun 2016 06:23:38 +0000
Subject: * insns.def (opt_succ): optimize like r55515. (but this argument is  
 consntant)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
---
 insns.def | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

(limited to 'insns.def')

diff --git a/insns.def b/insns.def
index 6a3a39cae8..7f7e3a07f8 100644
--- a/insns.def
+++ b/insns.def
@@ -2041,12 +2041,12 @@ opt_succ
     if (SPECIAL_CONST_P(recv)) {
 	if (FIXNUM_P(recv) &&
 	    BASIC_OP_UNREDEFINED_P(BOP_SUCC, INTEGER_REDEFINED_OP_FLAG)) {
-	    const VALUE obj = INT2FIX(1);
 	    /* fixnum + INT2FIX(1) */
-	    val = (recv + (obj & (~1)));
-	    if ((~(recv ^ obj) & (recv ^ val)) & ((unsigned long)LONG_MAX + 1)) {
-		val = rb_big_plus(rb_int2big(FIX2LONG(recv)),
-				  rb_int2big(FIX2LONG(obj)));
+	    if (recv != LONG2FIX(FIXNUM_MAX)) {
+		val = recv - 1 + INT2FIX(1);
+	    }
+	    else {
+		val = LONG2NUM(FIXNUM_MAX + 1);
 	    }
 	}
 	else {
-- 
cgit v1.2.3

