From: law Date: Thu, 16 Dec 1999 09:42:57 +0000 (+0000) Subject: * combine.c (simplify_comparison): Reduce (OP (MINUS A B) 0) X-Git-Tag: upstream/4.9.2~104137 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f9b38ae975be2dfbecba0329ddd719867ee82354;p=platform%2Fupstream%2Flinaro-gcc.git * combine.c (simplify_comparison): Reduce (OP (MINUS A B) 0) to (OP A B). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30970 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index acce2bf..35343e3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Thu Dec 16 02:41:26 1999 Richard Henderson (rth@cygnus.com) + + * combine.c (simplify_comparison): Reduce (OP (MINUS A B) 0) + to (OP A B). + Thu Dec 16 02:26:11 1999 Jeffrey A Law (law@cygnus.com) * h8300.md (HImode preinc peephole): Fix typo. diff --git a/gcc/combine.c b/gcc/combine.c index 5dc4fc8..3599168 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -10320,6 +10320,14 @@ simplify_comparison (code, pop0, pop1) break; case MINUS: + /* (op (minus A B) 0) -> (op A B) */ + if (op1 == const0_rtx) + { + op1 = XEXP (op0, 1); + op0 = XEXP (op0, 0); + continue; + } + /* (eq (minus A B) C) -> (eq A (plus B C)) or (eq B (minus A C)), whichever simplifies. We can only do this for equality comparisons due to pathological cases involving