Summary: | [3.2.1/3.3] gcc -O2 miscompiles Samba 2.2.7 on 32-bit sparc | ||
---|---|---|---|
Product: | gcc | Reporter: | eggert |
Component: | rtl-optimization | Assignee: | Eric Botcazou <ebotcazou> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | ehrhardt, gcc-bugs |
Priority: | P2 | Keywords: | wrong-code |
Version: | 3.2.1 | ||
Target Milestone: | 3.1.x/3.2.x | ||
Host: | sparc-sun-solaris2.8 | Target: | sparc-sun-solaris2.8 |
Build: | sparc-sun-solaris2.8 | Known to work: | |
Known to fail: | Last reconfirmed: |
Description
eggert
2002-11-26 17:06:00 UTC
Fix: A workaround is to not compile with -O2. From: "Christian Ehrhardt" <ehrhardt@mathematik.uni-ulm.de> To: Paul Eggert <eggert@twinsun.com> Cc: gcc-gnats@gcc.gnu.org Subject: Re: optimization/8726: GCC 3.2.1 miscompiles Samba 2.2.7 on 32-bit sparc Date: Wed, 27 Nov 2002 14:05:17 +0100 Hi, I can confirm this as a regression from 3.2. This is a somewhat modified example with types clean up a bit. Compile with -O2. The problem seems to be in the tail call optimizations. int fcntl_lock(int a, int b, int c, int d, double e, int f) { return f; } int vfswrap (int dummy, int a, int b, int c, int d, double e, int f) { return fcntl_lock(a, b, c, d, e, f); } int main (void) { return vfswrap (0, 1, 2, 3, 4, 5, 6); } The number of arguments and the placement of the double argument is important. From my tests it seems that the problem always arises if a 64bit argument is passed to vfswrap partly in register o5 and partly on the stack. Wenn passing all the arguments except the first one to fcntl_lock the optimizer doesn't move the following stack argmuments when reusing the existing stack frame. regards Christian State-Changed-From-To: open->analyzed State-Changed-Why: Confirmed as a regression, present in 3.2.2 Responsible-Changed-From-To: unassigned->ebotcazou Responsible-Changed-Why: I'm handling this. From: ebotcazou@gcc.gnu.org To: gcc-gnats@gcc.gnu.org Cc: Subject: optimization/8726 Date: 7 Mar 2003 07:52:43 -0000 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: ebotcazou@gcc.gnu.org 2003-03-07 07:52:43 Modified files: gcc : ChangeLog function.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.c-torture/execute: 20030307-1.c Log message: 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. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.270&r2=1.16114.2.271 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/function.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.389.2.1&r2=1.389.2.2 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.76&r2=1.2261.2.77 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/20030307-1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1 From: ebotcazou@gcc.gnu.org To: gcc-gnats@gcc.gnu.org Cc: Subject: optimization/8726 Date: 7 Mar 2003 07:58:39 -0000 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_2-branch Changes by: ebotcazou@gcc.gnu.org 2003-03-07 07:58:39 Modified files: gcc : ChangeLog function.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.c-torture/execute: 20030307-1.c Log message: 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. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.13152.2.657.2.248&r2=1.13152.2.657.2.249 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/function.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.347.2.10.2.2&r2=1.347.2.10.2.3 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.1672.2.166.2.103&r2=1.1672.2.166.2.104 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/20030307-1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.4.1 State-Changed-From-To: analyzed->closed State-Changed-Why: Fixed. See http://gcc.gnu.org/ml/gcc-patches/2003-03/msg00567.html This is still (again?) broken at least on the tree-ssa branch as of 26-Jan-2004. See testcase 20030307-1.c. No, the problem is fixed. The failure of the testcase is unrelated and should disappear with the next merge from mainline. Subject: Re: [3.2.1/3.3] gcc -O2 miscompiles Samba 2.2.7 on 32-bit sparc
On Tue, Jan 27, 2004 at 12:15:24PM -0000, ebotcazou at gcc dot gnu dot org wrote:
> No, the problem is fixed. The failure of the testcase is unrelated and should
> disappear with the next merge from mainline.
Sorry and thanks for the Info. Do you happen to know if there are
other known failures on sparc/tree-ssa? I get 44 testsuite failure
mostly in gcc/testsuite/gcc.dg/compat.
regards Christian
I don't know where they come from. I don't plan to work on tree-ssa until after it is merged in mainline. |