From: Roger Sayle Date: Mon, 10 Jun 2002 22:29:14 +0000 (+0000) Subject: simplify-rtx.c (simplify_replace_rtx): Allow replacement of matching registers. X-Git-Tag: releases/gcc-3.3.0~4425 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=60c86d4ee9e3256c02296b8953c5416decac0e1c;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5b4b671ef097..8d45988d5374 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 5db501eccfca..5a4509c602cd 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; }