diff options
author | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-16 18:58:12 +0000 |
---|---|---|
committer | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-16 18:58:12 +0000 |
commit | c353833f27e720d4528a6312c3d2d2699e1808df (patch) | |
tree | 25ae95e74904fca8e52e81ad950b154e1cfc464a | |
parent | 860251bec40a1182f2cec4c8039a6120c165271f (diff) | |
download | gcc-c353833f27e720d4528a6312c3d2d2699e1808df.tar.gz |
2003-05-02 Andrew Pinski <pinskia@physics.uc.edu>
* gcse.c (gcse_constant_p): COMPARE of the same registers is a constant
if they are not floating point registers.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69471 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/gcse.c | 11 |
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f8b4875def0..5778c5c8e1f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2003-07-16 Andrew Pinski <pinskia@physics.uc.edu> + * gcse.c (gcse_constant_p): COMPARE of the same registers is a constant + if they are not floating point registers. + +2003-07-16 Andrew Pinski <pinskia@physics.uc.edu> + PR c/10962 * ggc.h: Add header guards. * c-decl.c (finish_struct): Sort fields if diff --git a/gcc/gcse.c b/gcc/gcse.c index 30d4c1ee171..6420faf2a20 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -2123,6 +2123,17 @@ gcse_constant_p (rtx x) && GET_CODE (XEXP (x, 1)) == CONST_INT) return true; + + /* Consider a COMPARE of the same registers is a constant + if they are not floating point registers. */ + if (GET_CODE(x) == COMPARE + && GET_CODE (XEXP (x, 0)) == REG + && GET_CODE (XEXP (x, 1)) == REG + && REGNO (XEXP (x, 0)) == REGNO (XEXP (x, 1)) + && ! FLOAT_MODE_P (GET_MODE (XEXP (x, 0))) + && ! FLOAT_MODE_P (GET_MODE (XEXP (x, 1)))) + return true; + if (GET_CODE (x) == CONSTANT_P_RTX) return false; |