From: kenner Date: Sun, 13 Apr 1997 12:15:28 +0000 (+0000) Subject: (reload): If function has nonlocal label, mark all caller-saved regs X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=f668952a025d4d4a8f3215bc19b37b3ec0d96132 (reload): If function has nonlocal label, mark all caller-saved regs as used. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13863 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/reload1.c b/gcc/reload1.c index a7b4238d1b5..42fe5c7565c 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]);