summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/arm
diff options
context:
space:
mode:
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-04 12:44:01 +0000
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-04 12:44:01 +0000
commit4164ad584ebdc233ba487903d919c730768c82d3 (patch)
tree2c2e8b8f4d4f62d949c6bbb9dc5113108d6f3f8e /gcc/testsuite/gcc.target/arm
parent54007dc20d11032a1c3b28dec962c3cc48344d7c (diff)
downloadgcc-4164ad584ebdc233ba487903d919c730768c82d3.tar.gz
PR rtl-optimization/39871
PR rtl-optimization/40615 PR rtl-optimization/42500 PR rtl-optimization/42502 * ira.c (init_reg_equiv_memory_loc: New function. (ira): Call it twice. * reload.h (calculate_elim_costs_all_insns): Declare. * ira-costs.c: Include "reload.h". (regno_equiv_gains): New static variable. (init_costs): Allocate it. (finish_costs): Free it. (ira_costs): Call calculate_elim_costs_all_insns. (find_costs_and_classes): Take estimated elimination costs into account. (ira_adjust_equiv_reg_cost): New function. * ira.h (ira_adjust_equiv_reg_cost): Declare it. * reload1.c (init_eliminable_invariants, free_reg_equiv, elimination_costs_in_insn, note_reg_elim_costly): New static functions. (elim_bb): New static variable. (reload): Move code out of here into init_eliminable_invariants and free_reg_equiv. Call them. (calculate_elim_costs_all_insns): New function. (eliminate_regs_1): Declare. Add extra arg FOR_COSTS; all callers changed. If FOR_COSTS is true, don't call alter_reg, but call note_reg_elim_costly if we turned a valid memory address into an invalid one. * Makefile.in (ira-costs.o): Depend on reload.h. testsuite/ PR rtl-optimization/39871 PR rtl-optimization/40615 PR rtl-optimization/42500 PR rtl-optimization/42502 * gcc.target/arm/eliminate.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160260 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.target/arm')
-rw-r--r--gcc/testsuite/gcc.target/arm/eliminate.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/arm/eliminate.c b/gcc/testsuite/gcc.target/arm/eliminate.c
new file mode 100644
index 00000000000..f254dd811d2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/eliminate.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+struct X
+{
+ int c;
+};
+
+extern void bar(struct X *);
+
+void foo ()
+{
+ struct X x;
+ bar (&x);
+ bar (&x);
+ bar (&x);
+}
+
+/* { dg-final { scan-assembler-times "r0,\[\\t \]*sp" 3 } } */