From: Eric Botcazou Date: Fri, 7 Mar 2003 07:58:39 +0000 (+0100) Subject: re PR rtl-optimization/8726 ([3.2.1/3.3] gcc -O2 miscompiles Samba 2.2.7 on 32-bit... X-Git-Tag: releases/gcc-3.2.3~138 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4cbf0bedb50526f60a8e409d558b10e911865d04;p=thirdparty%2Fgcc.git re PR rtl-optimization/8726 ([3.2.1/3.3] gcc -O2 miscompiles Samba 2.2.7 on 32-bit sparc) PR optimization/8726 Backport patch from mainline: 2003-01-08 Dale Johannesen * function.c (assign_parms): Don't set pretend_args_size if REG_PARM_STACK_SPACE. From-SVN: r63938 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dc4208d1ba7f..c76147bf7c57 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2003-03-07 Eric Botcazou + + PR optimization/8726 + Backport patch from mainline: + + 2003-01-08 Dale Johannesen + + * function.c (assign_parms): Don't set pretend_args_size if + REG_PARM_STACK_SPACE. + 2003-03-06 Reinhard Jessich PR 9954/other diff --git a/gcc/function.c b/gcc/function.c index f7330762d1a8..2f63ecca2217 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -4581,6 +4581,12 @@ assign_parms (fndecl) if (nregs > 0) { +#if defined (REG_PARM_STACK_SPACE) && !defined (MAYBE_REG_PARM_STACK_SPACE) + /* When REG_PARM_STACK_SPACE is nonzero, stack space for + split parameters was allocated by our caller, so we + won't be pushing it in the prolog. */ + if (REG_PARM_STACK_SPACE (fndecl) == 0) +#endif current_function_pretend_args_size = (((nregs * UNITS_PER_WORD) + (PARM_BOUNDARY / BITS_PER_UNIT) - 1) / (PARM_BOUNDARY / BITS_PER_UNIT) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6eb7302f8831..99ce38298e92 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,6 +1,10 @@ +2003-03-07 Eric Botcazou + + * gcc.c-torture/execute/20030307-1.c: New test. + 2003-03-05 Eric Botcazou - * gcc.c-torture/compile/20030305-1.c + * gcc.c-torture/compile/20030305-1.c: New test. 2003-02-25 Franz Sirl diff --git a/gcc/testsuite/gcc.c-torture/execute/20030307-1.c b/gcc/testsuite/gcc.c-torture/execute/20030307-1.c new file mode 100644 index 000000000000..3f4eb864d6c2 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20030307-1.c @@ -0,0 +1,26 @@ +/* PR optimization/8726 */ +/* Originator: Paul Eggert */ + +/* Verify that GCC doesn't miscompile tail calls on Sparc. */ + +extern void abort(void); + +int fcntl_lock(int fd, int op, long long offset, long long count, int type); + +int vfswrap_lock(char *fsp, int fd, int op, long long offset, long long count, int type) +{ + return fcntl_lock(fd, op, offset, count, type); +} + +int fcntl_lock(int fd, int op, long long offset, long long count, int type) +{ + return type; +} + +int main(void) +{ + if (vfswrap_lock (0, 1, 2, 3, 4, 5) != 5) + abort(); + + return 0; +}