]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/8726 ([3.2.1/3.3] gcc -O2 miscompiles Samba 2.2.7 on 32-bit...
authorEric Botcazou <ebotcazou@libertysurf.fr>
Fri, 7 Mar 2003 07:58:39 +0000 (08:58 +0100)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Fri, 7 Mar 2003 07:58:39 +0000 (07:58 +0000)
PR optimization/8726
Backport patch from mainline:

2003-01-08  Dale Johannesen  <dalej@apple.com>

* function.c (assign_parms):  Don't set pretend_args_size if
REG_PARM_STACK_SPACE.

From-SVN: r63938

gcc/ChangeLog
gcc/function.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/20030307-1.c [new file with mode: 0644]

index dc4208d1ba7f7ff8bc0eff5308309bbaae1a46fd..c76147bf7c57466d265cad711d18fa0dbd542191 100644 (file)
@@ -1,3 +1,13 @@
+2003-03-07  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       PR optimization/8726
+       Backport patch from mainline:
+
+       2003-01-08  Dale Johannesen  <dalej@apple.com>
+
+       * function.c (assign_parms):  Don't set pretend_args_size if
+       REG_PARM_STACK_SPACE.
+
 2003-03-06  Reinhard Jessich <reinhard.jessich@telering.at>
 
        PR 9954/other
index f7330762d1a85f9bb53770aec1f7c5801a4c43d5..2f63ecca22179641408df4fe69393c04c51bc565 100644 (file)
@@ -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)
index 6eb7302f8831223f15b966522fad2ad7fbd4e6be..99ce38298e92add66eef4135d47c69c34186a9f6 100644 (file)
@@ -1,6 +1,10 @@
+2003-03-07  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       * gcc.c-torture/execute/20030307-1.c: New test.
+
 2003-03-05  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
-       * gcc.c-torture/compile/20030305-1.c
+       * gcc.c-torture/compile/20030305-1.c: New test.
 
 2003-02-25  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>
 
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 (file)
index 0000000..3f4eb86
--- /dev/null
@@ -0,0 +1,26 @@
+/* PR optimization/8726 */
+/* Originator: Paul Eggert <eggert@twinsun.com> */
+
+/* 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;
+}