aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBernd Schmidt <bernds@codesourcery.com>2010-08-10 18:45:10 +0000
committerBernd Schmidt <bernds@gcc.gnu.org>2010-08-10 18:45:10 +0000
commit8f4c6e28cf9c51e85b26e143cfc8104f134cbb2c (patch)
treeebfe1b2eaefb7d8e9915ce44623b6d7048de529e /gcc
parentc1510a4900e05983c03f36c7374b46bc2d2640b5 (diff)
downloadgcc-8f4c6e28cf9c51e85b26e143cfc8104f134cbb2c.zip
gcc-8f4c6e28cf9c51e85b26e143cfc8104f134cbb2c.tar.gz
gcc-8f4c6e28cf9c51e85b26e143cfc8104f134cbb2c.tar.bz2
re PR bootstrap/45177 (cc1 runs out of memory building libgcc in ARM cross-compiler)
PR bootstrap/45177 * config/arm/arm.c (multiple_operation_profitable_p): Move xscale test here from arm_gen_load_multiple_1. (arm_gen_load_multiple_1, arm_gen_store_multiple_1): Use multiple_operation_profitable_p. From-SVN: r163077
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/arm/arm.c64
2 files changed, 40 insertions, 32 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8679d42..8ae8811 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2010-08-10 Bernd Schmidt <bernds@codesourcery.com>
+
+ PR bootstrap/45177
+ * config/arm/arm.c (multiple_operation_profitable_p): Move xscale
+ test here from arm_gen_load_multiple_1.
+ (arm_gen_load_multiple_1, arm_gen_store_multiple_1): Use
+ multiple_operation_profitable_p.
+
2010-08-10 Nathan Froyd <froydnj@codesourcery.com>
* tree-ssa-prec. (init_pre): Call alloc_aux_for_blocks.
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index d0ea6e1..416068d 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -9289,6 +9289,36 @@ multiple_operation_profitable_p (bool is_store ATTRIBUTE_UNUSED,
if (nops == 2 && arm_ld_sched && add_offset != 0)
return false;
+ /* XScale has load-store double instructions, but they have stricter
+ alignment requirements than load-store multiple, so we cannot
+ use them.
+
+ For XScale ldm requires 2 + NREGS cycles to complete and blocks
+ the pipeline until completion.
+
+ NREGS CYCLES
+ 1 3
+ 2 4
+ 3 5
+ 4 6
+
+ An ldr instruction takes 1-3 cycles, but does not block the
+ pipeline.
+
+ NREGS CYCLES
+ 1 1-3
+ 2 2-6
+ 3 3-9
+ 4 4-12
+
+ Best case ldr will always win. However, the more ldr instructions
+ we issue, the less likely we are to be able to schedule them well.
+ Using ldr instructions also increases code size.
+
+ As a compromise, we use ldr for counts of 1 or 2 regs, and ldm
+ for counts of 3 or 4 regs. */
+ if (nops <= 2 && arm_tune_xscale && !optimize_size)
+ return false;
return true;
}
@@ -9641,35 +9671,7 @@ arm_gen_load_multiple_1 (int count, int *regs, rtx *mems, rtx basereg,
int i = 0, j;
rtx result;
- /* XScale has load-store double instructions, but they have stricter
- alignment requirements than load-store multiple, so we cannot
- use them.
-
- For XScale ldm requires 2 + NREGS cycles to complete and blocks
- the pipeline until completion.
-
- NREGS CYCLES
- 1 3
- 2 4
- 3 5
- 4 6
-
- An ldr instruction takes 1-3 cycles, but does not block the
- pipeline.
-
- NREGS CYCLES
- 1 1-3
- 2 2-6
- 3 3-9
- 4 4-12
-
- Best case ldr will always win. However, the more ldr instructions
- we issue, the less likely we are to be able to schedule them well.
- Using ldr instructions also increases code size.
-
- As a compromise, we use ldr for counts of 1 or 2 regs, and ldm
- for counts of 3 or 4 regs. */
- if (arm_tune_xscale && count <= 2 && ! optimize_size)
+ if (!multiple_operation_profitable_p (false, count, 0))
{
rtx seq;
@@ -9721,9 +9723,7 @@ arm_gen_store_multiple_1 (int count, int *regs, rtx *mems, rtx basereg,
if (GET_CODE (basereg) == PLUS)
basereg = XEXP (basereg, 0);
- /* See arm_gen_load_multiple_1 for discussion of
- the pros/cons of ldm/stm usage for XScale. */
- if (arm_tune_xscale && count <= 2 && ! optimize_size)
+ if (!multiple_operation_profitable_p (false, count, 0))
{
rtx seq;