public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][4.9]Backport "Fix register corruption bug in ree"
@ 2015-02-06 17:48 Renlin Li
  2015-03-02 14:14 ` [PING][PATCH][4.9]Backport " Renlin Li
  0 siblings, 1 reply; 8+ messages in thread
From: Renlin Li @ 2015-02-06 17:48 UTC (permalink / raw)
  To: gcc-patches; +Cc: marcus Shawcroft, Jeff Law, ramana Radhakrishnan

[-- Attachment #1: Type: text/plain, Size: 631 bytes --]

Hi all,

This is a backport patch for branch 4.9. You can find the original patch 
here: https://gcc.gnu.org/ml/gcc-patches/2014-09/msg00356.html
And it has been commit on the trunk as r215205.

This fixes a few libstdc++-v3 test suite failures.
x86_64 bootstraps Okay, aarch64_be-none-elf libstdc++-v3 tested Okay.

Okay to commit on branch 4.9?

Regards,
Renlin Li

2015-02-06  Renlin Li  <renlin.li@arm.com>

     Backport from mainline
     2014-09-12  Wilco Dijkstra  <wilco.dijkstra@arm.com>

     * gcc/ree.c (combine_reaching_defs): Ensure inserted copy don't change
     the number of hard registers.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch-1.diff --]
[-- Type: text/x-patch; name=patch-1.diff, Size: 1274 bytes --]

diff --git a/gcc/ree.c b/gcc/ree.c
index 67fc9c3..e9ff904 100644
--- a/gcc/ree.c
+++ b/gcc/ree.c
@@ -793,6 +793,14 @@ combine_reaching_defs (ext_cand *cand, const_rtx set_pat, ext_state *state)
       if (state->modified[INSN_UID (cand->insn)].kind != EXT_MODIFIED_NONE)
 	return false;
 
+      enum machine_mode dst_mode = GET_MODE (SET_DEST (PATTERN (cand->insn)));
+      rtx src_reg = get_extended_src_reg (SET_SRC (PATTERN (cand->insn)));
+
+      /* Ensure the number of hard registers of the copy match.  */
+      if (HARD_REGNO_NREGS (REGNO (src_reg), dst_mode)
+	  != HARD_REGNO_NREGS (REGNO (src_reg), GET_MODE (src_reg)))
+	return false;
+
       /* There's only one reaching def.  */
       rtx def_insn = state->defs_list[0];
 
@@ -842,7 +850,7 @@ combine_reaching_defs (ext_cand *cand, const_rtx set_pat, ext_state *state)
       start_sequence ();
       rtx pat = PATTERN (cand->insn);
       rtx new_dst = gen_rtx_REG (GET_MODE (SET_DEST (pat)),
-                                 REGNO (XEXP (SET_SRC (pat), 0)));
+				 REGNO (get_extended_src_reg (SET_SRC (pat))));
       rtx new_src = gen_rtx_REG (GET_MODE (SET_DEST (pat)),
                                  REGNO (SET_DEST (pat)));
       emit_move_insn (new_dst, new_src);

^ permalink raw reply	[flat|nested] 8+ messages in thread
[parent not found: <1C23526A7C42DB45BBF55B662C7C530E430D20FFFD@BUNGLE.Emea.Arm.com>]

end of thread, other threads:[~2015-11-09  8:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-06 17:48 [PATCH][4.9]Backport "Fix register corruption bug in ree" Renlin Li
2015-03-02 14:14 ` [PING][PATCH][4.9]Backport " Renlin Li
     [not found] <1C23526A7C42DB45BBF55B662C7C530E430D20FFFD@BUNGLE.Emea.Arm.com>
2015-04-16  9:32 ` Renlin Li
2015-06-04 13:20   ` Renlin Li
2015-10-29 15:41     ` Ramana Radhakrishnan
2015-10-29 16:41       ` Richard Biener
2015-11-06 17:25         ` Renlin Li
2015-11-09  8:32           ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).