diff mbox series

combine: More make_more_copies

Message ID 3086bff4510019762283300795d97e2f1c956aee.1541890736.git.segher@kernel.crashing.org
State New
Headers show
Series combine: More make_more_copies | expand

Commit Message

Segher Boessenkool Nov. 10, 2018, 11:06 p.m. UTC
This makes make_more_copies do what its documentation says, that is,
only make an intermediate pseudo if copying to a pseudo.

This regressed generated code quality when we didn't keep the original
notes that were on the copy, but since r265582 we do, and only allowing
pseudos now is a win.  It also simplifies the code.

Committing.


Segher


2018-11-10  Segher Boessenkool  <segher@kernel.crashing.org>

	* combine.c (make_more_copies): Only make an intermediate copy if the
	dest of a move is a pseudo.

---
 gcc/combine.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/gcc/combine.c b/gcc/combine.c
index 77eeae7..c314206 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -14990,12 +14990,11 @@  make_more_copies (void)
 	  rtx set = single_set (insn);
 	  if (!set)
 	    continue;
+
 	  rtx dest = SET_DEST (set);
-	  if (dest == pc_rtx)
-	    continue;
-	  /* See PR87871.  */
-	  if (dest == frame_pointer_rtx)
-	    continue;
+	  if (!(REG_P (dest) && !HARD_REGISTER_P (dest)))
+	      continue;
+
 	  rtx src = SET_SRC (set);
 	  if (!(REG_P (src) && HARD_REGISTER_P (src)))
 	    continue;