diff src/share/vm/opto/cfgnode.cpp @ 9154:886d1fd67dc3

6443505: Ideal() function for CmpLTMask Summary: Repair wrong code generation, added new matching rule Reviewed-by: kvn, twisti
author drchase
date Fri, 12 Apr 2013 19:14:47 -0700
parents d092d1b31229
children 6f3fd5150b67
line wrap: on
line diff
--- a/src/share/vm/opto/cfgnode.cpp	Fri Apr 12 20:37:18 2013 -0400
+++ b/src/share/vm/opto/cfgnode.cpp	Fri Apr 12 19:14:47 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1306,10 +1306,11 @@
     return NULL;
 
   Node *x = n2;
-  Node *y = n1->in(1);
-  if( n2 == n1->in(1) ) {
+  Node *y = NULL;
+  if( x == n1->in(1) ) {
     y = n1->in(2);
-  } else if( n2 == n1->in(1) ) {
+  } else if( x == n1->in(2) ) {
+    y = n1->in(1);
   } else return NULL;
 
   // Not so profitable if compare and add are constants