From 5648c5be94049bfdad624817a6c3f4f75df6ddfa Mon Sep 17 00:00:00 2001 From: Wolfgang Thaller Date: Thu, 25 Sep 2014 18:56:56 +0200 Subject: [PATCH] consider instructions of the form move.x (%ax)+, -(%ax) as no-op instructions. They really don't do anything, and they confuse the rest of the compiler when they are generated as a result of passing the result of one pascal function to another function. --- gcc/gcc/rtlanal.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/gcc/gcc/rtlanal.c b/gcc/gcc/rtlanal.c index 98fbacce4a..68df43b3d8 100644 --- a/gcc/gcc/rtlanal.c +++ b/gcc/gcc/rtlanal.c @@ -1180,7 +1180,24 @@ set_noop_p (const_rtx set) return 1; if (MEM_P (dst) && MEM_P (src)) - return rtx_equal_p (dst, src) && !side_effects_p (dst); + { + if (rtx_equal_p (dst, src) && !side_effects_p (dst)) + return 1; + + src = XEXP(src, 0); + dst = XEXP(dst, 0); + + if( GET_CODE(src) == POST_INC && GET_CODE(dst) == PRE_DEC ) + { + src = XEXP(src, 0); + dst = XEXP(dst, 0); + if (rtx_equal_p (dst, src) && !side_effects_p (dst)) + return 1; + + } + + return 0; + } if (GET_CODE (dst) == ZERO_EXTRACT) return rtx_equal_p (XEXP (dst, 0), src)