aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1997-04-13 08:15:28 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1997-04-13 08:15:28 -0400
commit8dddd002b0e059a7f8a6cd0147afea0d83188cac (patch)
tree4082173ad82240f8586082eef6fbb98fde6f4dde /gcc
parent1f027d54a1f8d5ca34a8924eeea12af92d1075c8 (diff)
downloadgcc-8dddd002b0e059a7f8a6cd0147afea0d83188cac.zip
gcc-8dddd002b0e059a7f8a6cd0147afea0d83188cac.tar.gz
gcc-8dddd002b0e059a7f8a6cd0147afea0d83188cac.tar.bz2
(reload): If function has nonlocal label, mark all caller-saved regs
as used. From-SVN: r13863
Diffstat (limited to 'gcc')
-rw-r--r--gcc/reload1.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c
index a7b4238..42fe5c7 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -589,10 +589,18 @@ reload (first, global, dumpfile)
as homes for pseudo registers.
This is done here rather than (eg) in global_alloc
because this point is reached even if not optimizing. */
-
for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
mark_home_live (i);
+ /* A function that receives a nonlocal goto must save all call-saved
+ registers. */
+ if (current_function_has_nonlocal_label)
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ {
+ if (! call_used_regs[i] && ! fixed_regs[i])
+ regs_ever_live[i] = 1;
+ }
+
for (i = 0; i < scratch_list_length; i++)
if (scratch_list[i])
mark_scratch_live (scratch_list[i]);