]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR target/78426 (wrong code with strncmp on SH)
authorKaz Kojima <kkojima@gcc.gnu.org>
Tue, 29 Nov 2016 23:23:30 +0000 (23:23 +0000)
committerKaz Kojima <kkojima@gcc.gnu.org>
Tue, 29 Nov 2016 23:23:30 +0000 (23:23 +0000)
Backported from mainline
2016-11-19  Kaz Kojima  <kkojima@gcc.gnu.org>

PR target/78426
* config/sh/sh-mem.cc (sh_expand_cmpnstr): Use copy_to_mode_reg
instead of force_reg.
(sh_expand_setmem): Likewise.

From-SVN: r242982

gcc/ChangeLog
gcc/config/sh/sh-mem.cc

index 54a9b2ac454c23d58962f0ea05745bf1101cc031..12b758b08146a4e7f5cc7e149d8b2684e57172ad 100644 (file)
@@ -1,3 +1,13 @@
+2016-11-29  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+       Backported from mainline
+       2016-11-19  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+       PR target/78426
+       * config/sh/sh-mem.cc (sh_expand_cmpnstr): Use copy_to_mode_reg
+       instead of force_reg.
+       (sh_expand_setmem): Likewise.
+
 2016-11-24  Martin Liska  <mliska@suse.cz>
        Backported from mainline
        2016-11-22  Martin Liska  <mliska@suse.cz>
index d09209004a670d72991e7f881e9afba52ab61335..a9d7b9afc970064cc2b478d3d25488d8b2d2ec75 100644 (file)
@@ -363,7 +363,7 @@ sh_expand_cmpnstr (rtx *operands)
   rtx_code_label *L_loop_byte = gen_label_rtx ();
   rtx_code_label *L_end_loop_byte = gen_label_rtx ();
 
-  rtx len = force_reg (SImode, operands[3]);
+  rtx len = copy_to_mode_reg (SImode, operands[3]);
   int constp = CONST_INT_P (operands[3]);
 
   /* Loop on a register count.  */
@@ -674,9 +674,9 @@ sh_expand_setmem (rtx *operands)
   rtx jump;
   rtx dest = copy_rtx (operands[0]);
   rtx dest_addr = copy_addr_to_reg (XEXP (dest, 0));
-  rtx val = force_reg (SImode, operands[2]);
+  rtx val = copy_to_mode_reg (SImode, operands[2]);
   int align = INTVAL (operands[3]);
-  rtx len = force_reg (SImode, operands[1]);
+  rtx len = copy_to_mode_reg (SImode, operands[1]);
 
   if (! CONST_INT_P (operands[1]))
     return;