Fix va-arg-22.c at -O1 on m32r.
authorJeff Law <law@redhat.com>
Fri, 3 Apr 2020 18:46:13 +0000 (12:46 -0600)
committerJeff Law <law@redhat.com>
Fri, 3 Apr 2020 18:46:13 +0000 (12:46 -0600)
PR rtl-optimization/92264
* config/m32r/m32r.c (m32r_output_block_move): Properly account for
post-increment addressing of source operands as well as residuals
when computing any adjustments to the input pointer.

gcc/ChangeLog
gcc/config/m32r/m32r.c

index 7083bbb9cce925c5652457ddce57ade3d59f013f..e9dfa71ec0e410949ce773f82bf40515a133c7fd 100644 (file)
@@ -1,3 +1,10 @@
+2020-04-03  Jeff Law  <law@redhat.com>
+
+       PR rtl-optimization/92264
+       * config/m32r/m32r.c (m32r_output_block_move): Properly account for
+       post-increment addressing of source operands as well as residuals
+       when computing any adjustments to the input pointer.
+
 2020-04-03  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/94460
index 1c0156095244e60a1bf234ec2df883f976a12d29..27fb495ed172c473e9e2da928e4249e662e017c4 100644 (file)
@@ -2676,7 +2676,7 @@ m32r_output_block_move (rtx insn ATTRIBUTE_UNUSED, rtx operands[])
             destination pointer.  */
          int dst_inc_amount = dst_offset + bytes - 4;
          /* The same for the source pointer.  */
-         int src_inc_amount = bytes;
+         int src_inc_amount = bytes - (got_extra ? 4 : 0);
          int last_shift;
          rtx my_operands[3];