summaryrefslogtreecommitdiffstats
path: root/gcc/regclass.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1994-01-11 00:16:27 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1994-01-11 00:16:27 +0000
commitb8f0384ba5145397194ce6332ac8a32254f6bf6e (patch)
treec6bec2d2e5dd40733bd2d4ce9a34cdac3135fa5a /gcc/regclass.c
parent11088b43c27aafe99b6e9723d49c88e02df2f5a5 (diff)
downloadppe42-gcc-b8f0384ba5145397194ce6332ac8a32254f6bf6e.tar.gz
ppe42-gcc-b8f0384ba5145397194ce6332ac8a32254f6bf6e.zip
(globalize_reg): New function.
(init_reg_sets_1): Don't handle global regs here. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@6371 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/regclass.c')
-rw-r--r--gcc/regclass.c41
1 files changed, 30 insertions, 11 deletions
diff --git a/gcc/regclass.c b/gcc/regclass.c
index 1453d0e9175..a922afdaeb3 100644
--- a/gcc/regclass.c
+++ b/gcc/regclass.c
@@ -1,5 +1,5 @@
/* Compute register class preferences for pseudo-registers.
- Copyright (C) 1987, 1988, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 91, 92, 93, 1994 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -361,16 +361,6 @@ init_reg_sets_1 ()
CONDITIONAL_REGISTER_USAGE;
#endif
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (global_regs[i])
- {
- if (call_used_regs[i] && ! fixed_regs[i])
- warning ("call-clobbered register used for global register variable");
- fixed_regs[i] = 1;
- /* Prevent saving/restoring of this reg. */
- call_used_regs[i] = 1;
- }
-
/* Initialize "constant" tables. */
CLEAR_HARD_REG_SET (fixed_reg_set);
@@ -434,6 +424,35 @@ fix_register (name, fixed, call_used)
warning ("unknown register name: %s", name);
}
}
+
+/* Mark register number I as global. */
+
+void
+globalize_reg (i)
+ int i;
+{
+ if (global_regs[i])
+ {
+ warning ("register used for two global register variables");
+ return;
+ }
+
+ if (call_used_regs[i] && ! fixed_regs[i])
+ warning ("call-clobbered register used for global register variable");
+
+ global_regs[i] = 1;
+
+ /* If already fixed, nothing else to do. */
+ if (fixed_regs[i])
+ return;
+
+ fixed_regs[i] = call_used_regs[i] = call_fixed_regs[i] = 1;
+ n_non_fixed_regs--;
+
+ SET_HARD_REG_BIT (fixed_reg_set, i);
+ SET_HARD_REG_BIT (call_used_reg_set, i);
+ SET_HARD_REG_BIT (call_fixed_reg_set, i);
+}
/* Now the data and code for the `regclass' pass, which happens
just before local-alloc. */
OpenPOWER on IntegriCloud