From: rsandifo Date: Mon, 18 Nov 2002 12:35:15 +0000 (+0000) Subject: * config/sh/sh.c (calc_live_regs): Update check for PIC liveness X-Git-Tag: upstream/4.9.2~83383 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6977cd6403fab095dc112eec04754dccfeffee6c;p=platform%2Fupstream%2Flinaro-gcc.git * config/sh/sh.c (calc_live_regs): Update check for PIC liveness in compact code. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59212 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7e810c5..7ab6bca 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2002-11-18 Richard Sandiford + * config/sh/sh.c (calc_live_regs): Update check for PIC liveness + in compact code. + +2002-11-18 Richard Sandiford + * config/sh/sh.md (initialize_trampoline): Do not force the trampoline address into R0_REGS here. diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 0ce5e06..1b3f92d 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -4456,7 +4456,11 @@ calc_live_regs (count_ptr, live_regs_mask) && reg != RETURN_ADDRESS_POINTER_REGNUM && reg != T_REG && reg != GBR_REG) : (/* Only push those regs which are used and need to be saved. */ - regs_ever_live[reg] && ! call_used_regs[reg])) + (TARGET_SHCOMPACT + && flag_pic + && current_function_args_info.call_cookie + && reg == PIC_OFFSET_TABLE_REGNUM) + || (regs_ever_live[reg] && ! call_used_regs[reg]))) { live_regs_mask[reg / 32] |= 1 << (reg % 32); count += GET_MODE_SIZE (REGISTER_NATURAL_MODE (reg)); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ca431f1..899f448 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2002-11-18 Richard Sandiford + + * gcc.c-torture/execute/20021118-1.c: New test. + 2002-11-16 Jakub Jelinek * gcc.dg/20021116-1.c: New test. diff --git a/gcc/testsuite/gcc.c-torture/execute/20021118-1.c b/gcc/testsuite/gcc.c-torture/execute/20021118-1.c new file mode 100644 index 0000000..0c1f800 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20021118-1.c @@ -0,0 +1,15 @@ +struct s { int f[4]; }; + +int foo (struct s s, int x1, int x2, int x3, int x4, int x5, int x6, int x7) +{ + return s.f[3] + x7; +} + +int main () +{ + struct s s = { 1, 2, 3, 4 }; + + if (foo (s, 100, 200, 300, 400, 500, 600, 700) != 704) + abort (); + exit (0); +}