From: Richard Henderson Date: Sun, 16 Jun 2002 21:52:45 +0000 (-0700) Subject: regclass.c (globalize_reg): Update regs_invalidated_by_call. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=caecc0998a40500e7da4e45c0c553266cf35a27c;p=gcc.git regclass.c (globalize_reg): Update regs_invalidated_by_call. * regclass.c (globalize_reg): Update regs_invalidated_by_call. * gcc.dg/20020616-1.c: New. From-SVN: r54681 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 72678e57e02..6ea3f3fc371 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,14 +1,19 @@ +2002-06-16 Richard Henderson + + PR opt/6722 + * regclass.c (globalize_reg): Update regs_invalidated_by_call. + 2002-06-16 Neil Booth - * config.gcc: Add an i386/sysv4-cpp.h. Remove i386-aout.h from - vxworks. -config/i386: - * i386-aout.h, i386elf.h, sysv4.h: Remove CPP_PREDEFINES. - * linux64.h: Use TARGET_OS_CPP_BUILTINS rather than + * config.gcc: Add i386/sysv4-cpp.h; remove i386-aout.h from vxworks. + * config/i386/i386-aout.h, config/i386/i386elf.h, + config/i386/sysv4.h: Remove CPP_PREDEFINES. + * config/i386/linux64.h, config/i386/i386elf.h, config/i386/mach.h, + config/i386/netware.h, config/i386/rtemself.h, config/i386/sco5.h, + config/i386/sol2.h, config/i386/vsta.h, config/i386/vxi386.h, + config/i386/win32.h: Use TARGET_OS_CPP_BUILTINS rather than CPP_PREDEFINES and part of CPP_SPEC. - i386elf.h, mach.h, netware.h, rtemself.h, sco5.h, sol2.h, - vsta.h, vxi386.h, win32.h: Similarly. - * sysv4-cpp.h: New. + * config/i386/sysv4-cpp.h: New. 2002-06-16 Richard Henderson diff --git a/gcc/regclass.c b/gcc/regclass.c index 6a7acb9793d..84bf97f21db 100644 --- a/gcc/regclass.c +++ b/gcc/regclass.c @@ -824,6 +824,7 @@ globalize_reg (i) 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); + SET_HARD_REG_BIT (regs_invalidated_by_call, i); } /* Now the data and code for the `regclass' pass, which happens diff --git a/gcc/testsuite/gcc.dg/20020616-1.c b/gcc/testsuite/gcc.dg/20020616-1.c new file mode 100644 index 00000000000..4630664d957 --- /dev/null +++ b/gcc/testsuite/gcc.dg/20020616-1.c @@ -0,0 +1,29 @@ +/* PR opt/6722 */ +/* { dg-do run { target i?86-*-* } } */ +/* { dg-options "-O2" } */ + +register int k asm("%ebx"); + +void __attribute__((noinline)) +foo() +{ + k = 1; +} + +void test() +{ + int i; + for (i = 0; i < 10; i += k) + { + k = 0; + foo(); + } +} + +int main() +{ + int old = k; + test(); + k = old; + return 0; +}