aboutsummaryrefslogtreecommitdiff
path: root/gcc/final.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1997-06-09 09:19:15 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1997-06-09 09:19:15 -0400
commitb88c92ccb2bd49a12ce31432a36a42bec4a9b8bd (patch)
treee572f320b17b185307493fa2f8668bf6d98d9abe /gcc/final.c
parentf9dcab5273c6957efd1249ab66bbb63ef86edf38 (diff)
downloadgcc-b88c92ccb2bd49a12ce31432a36a42bec4a9b8bd.zip
gcc-b88c92ccb2bd49a12ce31432a36a42bec4a9b8bd.tar.gz
gcc-b88c92ccb2bd49a12ce31432a36a42bec4a9b8bd.tar.bz2
(final_scan_insn): Use single_set to check cc_status.flags.
From-SVN: r14177
Diffstat (limited to 'gcc/final.c')
-rw-r--r--gcc/final.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/gcc/final.c b/gcc/final.c
index be46e06..91ad498 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -1651,7 +1651,7 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
default:
{
- register rtx body = PATTERN (insn);
+ register rtx body = PATTERN (insn), set;
int insn_code_number;
char *template;
rtx note;
@@ -1853,6 +1853,8 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
body = PATTERN (insn);
#ifdef HAVE_cc0
+ set = single_set(insn);
+
/* Check for redundant test and compare instructions
(when the condition codes are already set up as desired).
This is done only when optimizing; if not optimizing,
@@ -1863,7 +1865,9 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
if (optimize)
{
+#if 0
rtx set = single_set(insn);
+#endif
if (set
&& GET_CODE (SET_DEST (set)) == CC0
@@ -1978,20 +1982,20 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
handle conditional moves (if this machine has either one). */
if (cc_status.flags != 0
- && GET_CODE (body) == SET)
+ && set != 0)
{
rtx cond_rtx, then_rtx, else_rtx;
if (GET_CODE (insn) != JUMP_INSN
- && GET_CODE (SET_SRC (body)) == IF_THEN_ELSE)
+ && GET_CODE (SET_SRC (set)) == IF_THEN_ELSE)
{
- cond_rtx = XEXP (SET_SRC (body), 0);
- then_rtx = XEXP (SET_SRC (body), 1);
- else_rtx = XEXP (SET_SRC (body), 2);
+ cond_rtx = XEXP (SET_SRC (set), 0);
+ then_rtx = XEXP (SET_SRC (set), 1);
+ else_rtx = XEXP (SET_SRC (set), 2);
}
else
{
- cond_rtx = SET_SRC (body);
+ cond_rtx = SET_SRC (set);
then_rtx = const_true_rtx;
else_rtx = const0_rtx;
}
@@ -2014,12 +2018,12 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
break;
result = alter_cond (cond_rtx);
if (result == 1)
- validate_change (insn, &SET_SRC (body), then_rtx, 0);
+ validate_change (insn, &SET_SRC (set), then_rtx, 0);
else if (result == -1)
- validate_change (insn, &SET_SRC (body), else_rtx, 0);
+ validate_change (insn, &SET_SRC (set), else_rtx, 0);
else if (result == 2)
INSN_CODE (insn) = -1;
- if (SET_DEST (body) == SET_SRC (body))
+ if (SET_DEST (set) == SET_SRC (set))
{
PUT_CODE (insn, NOTE);
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;