aboutsummaryrefslogtreecommitdiff
path: root/gcc/final.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2012-11-05 21:11:04 +0000
committerAndreas Schwab <schwab@gcc.gnu.org>2012-11-05 21:11:04 +0000
commit511d31d856ee3ecf3296f46aed7c8e15611793fb (patch)
treee83690f770534b0780f3bf05985da435f3861cd5 /gcc/final.c
parente77c9aedcda056161ff93b55c86789266c1895c9 (diff)
downloadgcc-511d31d856ee3ecf3296f46aed7c8e15611793fb.zip
gcc-511d31d856ee3ecf3296f46aed7c8e15611793fb.tar.gz
gcc-511d31d856ee3ecf3296f46aed7c8e15611793fb.tar.bz2
final.c (final_scan_insn): Handle all comparison codes in non-jump and cmove insn.
* gcc/final.c (final_scan_insn) [HAVE_cc0]: Handle all comparison codes in non-jump and cmove insn. * gcc/testsuite/gcc.dg/torture/fp-compare.c: New testcase. From-SVN: r193187
Diffstat (limited to 'gcc/final.c')
-rw-r--r--gcc/final.c43
1 files changed, 13 insertions, 30 deletions
diff --git a/gcc/final.c b/gcc/final.c
index f69963d..fc10dd6 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -1,7 +1,7 @@
/* Convert RTL to assembler code and output it, for GNU compiler.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
- 2010, 2011
+ 2010, 2011, 2012
Free Software Foundation, Inc.
This file is part of GCC.
@@ -2689,36 +2689,19 @@ final_scan_insn (rtx insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED,
else_rtx = const0_rtx;
}
- switch (GET_CODE (cond_rtx))
+ if (COMPARISON_P (cond_rtx)
+ && XEXP (cond_rtx, 0) == cc0_rtx)
{
- case GTU:
- case GT:
- case LTU:
- case LT:
- case GEU:
- case GE:
- case LEU:
- case LE:
- case EQ:
- case NE:
- {
- int result;
- if (XEXP (cond_rtx, 0) != cc0_rtx)
- break;
- result = alter_cond (cond_rtx);
- if (result == 1)
- validate_change (insn, &SET_SRC (set), then_rtx, 0);
- else if (result == -1)
- validate_change (insn, &SET_SRC (set), else_rtx, 0);
- else if (result == 2)
- INSN_CODE (insn) = -1;
- if (SET_DEST (set) == SET_SRC (set))
- delete_insn (insn);
- }
- break;
-
- default:
- break;
+ int result;
+ result = alter_cond (cond_rtx);
+ if (result == 1)
+ validate_change (insn, &SET_SRC (set), then_rtx, 0);
+ else if (result == -1)
+ validate_change (insn, &SET_SRC (set), else_rtx, 0);
+ else if (result == 2)
+ INSN_CODE (insn) = -1;
+ if (SET_DEST (set) == SET_SRC (set))
+ delete_insn (insn);
}
}