From c43fbd618bc9861295fd1ce66cac6c8145b13782 Mon Sep 17 00:00:00 2001 From: hainque Date: Thu, 28 Jun 2012 07:56:40 +0000 Subject: [PATCH] * expr.c (convert_move): Latch mem integer inputs into a register before expanding a multi-instructions sequence. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@189040 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/expr.c | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dd228e8..213cca1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2012-06-28 OLivier Hainque + + * expr.c (convert_move): Latch mem integer inputs into a + register before expanding a multi-instructions sequence. + 2012-06-28 Alexandre Oliva , Uros Bizjak , Jakub Jelinek diff --git a/gcc/expr.c b/gcc/expr.c index 5295da2..0d26442 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -520,10 +520,13 @@ convert_move (rtx to, rtx from, int unsignedp) /* No special multiword conversion insn; do it by hand. */ start_sequence (); - /* Since we will turn this into a no conflict block, we must ensure - that the source does not overlap the target. */ + /* Since we will turn this into a no conflict block, we must ensure the + the source does not overlap the target so force it into an isolated + register when maybe so. Likewise for any MEM input, since the + conversion sequence might require several references to it and we + must ensure we're getting the same value every time. */ - if (reg_overlap_mentioned_p (to, from)) + if (MEM_P (from) || reg_overlap_mentioned_p (to, from)) from = force_reg (from_mode, from); /* Get a copy of FROM widened to a word, if necessary. */ -- 2.7.4