aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/s390/s390.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2005-06-04 13:54:48 +0000
committerJan Hubicka <jh@suse.cz>2005-06-04 13:54:48 +0000
commitf02ebad6e149ca06650b09a2bb88921ee86d651a (patch)
treed0964adef6a41f0707fc09b2e71e4c716c302552 /gcc/config/s390/s390.c
parentf8a262d3463a8787af1353714a0d4747987eabb6 (diff)
* Merge from mainline (tree-profiling-merge-20050603)tree-profiling-branch
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-profiling-branch@100586 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/s390/s390.c')
-rw-r--r--gcc/config/s390/s390.c66
1 files changed, 26 insertions, 40 deletions
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 2c860e7da1b..354f55e26fb 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -186,7 +186,6 @@ enum processor_flags s390_tune_flags;
/* Which instruction set architecture to use. */
enum processor_type s390_arch;
enum processor_flags s390_arch_flags;
-static const char *s390_arch_string;
HOST_WIDE_INT s390_warn_framesize = 0;
HOST_WIDE_INT s390_stack_size = 0;
@@ -1128,7 +1127,6 @@ s390_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED)
switch (code)
{
case OPT_march_:
- s390_arch_string = arg;
return s390_handle_arch_option (arg, &s390_arch, &s390_arch_flags);
case OPT_mstack_guard_:
@@ -4674,15 +4672,12 @@ s390_add_execute (struct constant_pool *pool, rtx insn)
if (c == NULL)
{
- rtx label = s390_execute_label (insn);
- gcc_assert (label);
-
c = (struct constant *) xmalloc (sizeof *c);
c->value = insn;
- c->label = label == const0_rtx ? gen_label_rtx () : XEXP (label, 0);
+ c->label = gen_label_rtx ();
c->next = pool->execute;
pool->execute = c;
- pool->size += label == const0_rtx ? 6 : 0;
+ pool->size += 6;
}
}
@@ -4734,28 +4729,6 @@ s390_execute_target (rtx insn)
return pattern;
}
-/* Dump out the out-of-pool execute template insns in POOL
- at the end of the instruction stream. */
-
-static void
-s390_dump_execute (struct constant_pool *pool)
-{
- struct constant *c;
- rtx insn;
-
- for (c = pool->execute; c; c = c->next)
- {
- if (s390_execute_label (c->value) == const0_rtx)
- continue;
-
- insn = emit_label (c->label);
- INSN_ADDRESSES_NEW (insn, -1);
-
- insn = emit_insn (s390_execute_target (c->value));
- INSN_ADDRESSES_NEW (insn, -1);
- }
-}
-
/* Indicate that INSN cannot be duplicated. This is the case for
execute insns that carry a unique label. */
@@ -4831,9 +4804,6 @@ s390_dump_pool (struct constant_pool *pool, bool remote_label)
/* Output in-pool execute template insns. */
for (c = pool->execute; c; c = c->next)
{
- if (s390_execute_label (c->value) != const0_rtx)
- continue;
-
insn = emit_label_after (c->label, insn);
INSN_ADDRESSES_NEW (insn, -1);
@@ -4853,9 +4823,6 @@ s390_dump_pool (struct constant_pool *pool, bool remote_label)
/* Remove placeholder insn. */
remove_insn (pool->pool_insn);
-
- /* Output out-of-pool execute template isns. */
- s390_dump_execute (pool);
}
/* Free all memory used by POOL. */
@@ -4905,7 +4872,7 @@ s390_mainpool_start (void)
pool->pool_insn = insn;
}
- if (s390_execute_label (insn))
+ if (!TARGET_CPU_ZARCH && s390_execute_label (insn))
{
s390_add_execute (pool, insn);
}
@@ -4950,9 +4917,6 @@ s390_mainpool_finish (struct constant_pool *pool)
/* If the pool is empty, we're done. */
if (pool->size == 0)
{
- /* However, we may have out-of-pool execute templates. */
- s390_dump_execute (pool);
-
/* We don't actually need a base register after all. */
cfun->machine->base_reg = NULL_RTX;
@@ -5105,7 +5069,7 @@ s390_chunkify_start (void)
}
}
- if (s390_execute_label (insn))
+ if (!TARGET_CPU_ZARCH && s390_execute_label (insn))
{
if (!curr_pool)
curr_pool = s390_start_pool (&pool_list, insn);
@@ -8190,6 +8154,28 @@ s390_reorg (void)
break;
}
+ /* Generate out-of-pool execute target insns. */
+ if (TARGET_CPU_ZARCH)
+ {
+ rtx insn, label, target;
+
+ for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
+ {
+ label = s390_execute_label (insn);
+ if (!label)
+ continue;
+
+ gcc_assert (label != const0_rtx);
+
+ target = emit_label (XEXP (label, 0));
+ INSN_ADDRESSES_NEW (target, -1);
+
+ target = emit_insn (s390_execute_target (insn));
+ INSN_ADDRESSES_NEW (target, -1);
+ }
+ }
+
+ /* Try to optimize prologue and epilogue further. */
s390_optimize_prologue ();
}