From 60c86d4ee9e3256c02296b8953c5416decac0e1c Mon Sep 17 00:00:00 2001 From: Roger Sayle Date: Mon, 10 Jun 2002 22:29:14 +0000 Subject: [PATCH] simplify-rtx.c (simplify_replace_rtx): Allow replacement of matching registers. * simplify-rtx.c (simplify_replace_rtx): Allow replacement of matching registers. From-SVN: r54476 --- gcc/ChangeLog | 5 +++++ gcc/simplify-rtx.c | 17 +++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5b4b671ef09..8d45988d537 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-06-10 Roger Sayle + + * simplify-rtx.c (simplify_replace_rtx): Allow replacement + of matching registers. + 2002-06-10 Roger Sayle * toplev.c (rest_of_compilation): Disable early if-conversion pass. diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 5db501eccfc..5a4509c602c 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -349,14 +349,19 @@ simplify_replace_rtx (x, old, new) } return x; - default: - if (GET_CODE (x) == MEM) - return - replace_equiv_address_nv (x, - simplify_replace_rtx (XEXP (x, 0), - old, new)); + case 'o': + if (code == MEM) + return replace_equiv_address_nv (x, + simplify_replace_rtx (XEXP (x, 0), + old, new)); + + if (REG_P (x) && REG_P (old) && REGNO (x) == REGNO (old)) + return new; return x; + + default: + return x; } return x; } -- 2.30.2