Hi, Thanks for the review, views and comments on the issue. >> -1 is an integer constant, so that's still invalid. It is also invalid for >> unsigned. The :s are useless since the output is a single insn. The patch is modified as per your review comments. Currently the following conditions had been taken care in the patch as per your suggestions:- a * c op b * c -> Optimizes for all cases a * c op b * c -> Does not optimize when c = 0 a * -c eq/ne b * -c -> Optimizes for all cases a * -c lt/gt/ge/le b * -c -> Optimizes when c is positive a * -c lt/gt/ge/le b * -c -> Optimizes and becomes b lt/gt/ge/le when c is negative Have added a minimal testcase which covers all the above instances. Please review the patch and let me know if its okay? Thanks, Naveen