This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] h8300.c: Move some static variabels inside a function.
- From: Kazu Hirata <kazu at hxi dot com>
- To: gcc-patches at gcc dot gnu dot org
- Subject: [patch] h8300.c: Move some static variabels inside a function.
Hi,
Attached is a patch to move some static variables inside the only
function that uses them.
Tested on h8300 port. Committed.
Kazu Hirata
2002-02-02 Kazu Hirata <kazu@hxi.com>
* config/h8300/h8300.c (h8_push_ops): Move inside
h8300_init_once.
(h8_pop_ops): Likewise.
(h8_move_ops): Likewise.
Index: h8300.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.c,v
retrieving revision 1.107
diff -u -r1.107 h8300.c
--- h8300.c 2002/02/03 01:24:11 1.107
+++ h8300.c 2002/02/03 01:26:04
@@ -96,10 +96,6 @@
/* Various operations needed by the following, indexed by CPU_TYPE. */
-static const char *const h8_push_ops[2] = { "push", "push.l" };
-static const char *const h8_pop_ops[2] = { "pop", "pop.l" };
-static const char *const h8_mov_ops[2] = { "mov.w", "mov.l" };
-
const char *h8_push_op, *h8_pop_op, *h8_mov_op;
/* Initialize the GCC target structure. */
@@ -121,6 +117,10 @@
void
h8300_init_once ()
{
+ static const char *const h8_push_ops[2] = { "push" , "push.l" };
+ static const char *const h8_pop_ops[2] = { "pop" , "pop.l" };
+ static const char *const h8_mov_ops[2] = { "mov.w", "mov.l" };
+
if (TARGET_H8300)
{
cpu_type = (int) CPU_H8300;