commit 1c51dda9a66fc997ab0ab1e4de66ff861b4a9545
Author: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Date: Wed Mar 18 14:53:13 2015 +0000
[ARM][cleanup] Use std::sort rather than manually sorting in gen_ldm_seq
@@ -14407,7 +14407,7 @@ gen_ldm_seq (rtx *operands, int nops, bool sort_regs)
{
int regs[MAX_LDM_STM_OPS], mem_order[MAX_LDM_STM_OPS];
rtx mems[MAX_LDM_STM_OPS];
- int i, j, base_reg;
+ int i, base_reg;
rtx base_reg_rtx;
HOST_WIDE_INT offset;
int write_back = FALSE;
@@ -14421,14 +14421,8 @@ gen_ldm_seq (rtx *operands, int nops, bool sort_regs)
return false;
if (sort_regs)
- for (i = 0; i < nops - 1; i++)
- for (j = i + 1; j < nops; j++)
- if (regs[i] > regs[j])
- {
- int t = regs[i];
- regs[i] = regs[j];
- regs[j] = t;
- }
+ std::sort (regs, regs + nops);
+
base_reg_rtx = gen_rtx_REG (Pmode, base_reg);
if (TARGET_THUMB1)