Summary: | [SPARC64] gcc produces wrong code when passing structures by value | ||
---|---|---|---|
Product: | gcc | Reporter: | p.van-hoof |
Component: | target | Assignee: | Eric Botcazou <ebotcazou> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | briant, ehrhardt, gcc-bugs |
Priority: | P3 | Keywords: | wrong-code |
Version: | 3.2.2 | ||
Target Milestone: | 3.3.1 | ||
Host: | sparc-sun-solaris2.9 | Target: | sparc-sun-solaris2.9 |
Build: | sparc-sun-solaris2.9 | Known to work: | |
Known to fail: | Last reconfirmed: | 2003-06-09 15:11:49 |
Description
p.van-hoof
2003-03-18 23:26:00 UTC
State-Changed-From-To: open->analyzed State-Changed-Why: Confirmed on all active branches. The obvious workaround is to pass the structure by reference. gcc 2.95.3 ICEs on the testcase so this is not a regression. From: "Christian Ehrhardt" <ehrhardt@mathematik.uni-ulm.de> To: p.van-hoof@qub.ac.uk, gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-prs@gcc.gnu.org Cc: Subject: Re: c/10142: [Sparc] gcc -m64 produces wrong code when passing structures by value Date: Mon, 14 Apr 2003 19:22:49 +0200 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10142 This patch seems to fix the problem for me, but regtests are still in progress and I'm not completly sure what the test is supposed to do in the first place. Index: calls.c =================================================================== RCS file: /cvsroot/gcc/gcc/gcc/calls.c,v retrieving revision 1.263 diff -u -r1.263 calls.c --- calls.c 14 Mar 2003 01:59:16 -0000 1.263 +++ calls.c 14 Apr 2003 17:20:36 -0000 @@ -1317,7 +1317,11 @@ it means that we are to pass this arg in the register(s) designated by the PARALLEL, but also to pass it in the stack. */ if (args[i].reg && GET_CODE (args[i].reg) == PARALLEL +#if 0 && XEXP (XVECEXP (args[i].reg, 0, 0), 0) == 0) +#else + ) +#endif args[i].pass_on_stack = 1; /* If this is an addressable type, we must preallocate the stack regards Christian -- THAT'S ALL FOLKS! I'll look into this one. Investigating. *** Bug 11136 has been marked as a duplicate of this bug. *** Subject: Bug 10142 CVSROOT: /cvs/gcc Module name: gcc Changes by: ebotcazou@gcc.gnu.org 2003-06-13 03:56:13 Modified files: gcc : ChangeLog gcc/config/sparc: sparc.c Log message: PR target/10142 * config/sparc/sparc.c (function_arg_record_value_parms): Add new 'stack' field. (function_arg_record_value_1): Set 'stack' to 1 if we run out of integer slots for an integer field. (function_arg_record_value_3): Shift vector index. (function_arg_record_value_2): Likewise. (function_arg_record_value): Initialize 'stack' to 0. Set 'stack' to 1 if we run out of integer slots for an integer field. Generate (parallel [(expr_list (nil) ...) ...]) if 'stack' is set to 1. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=1.18182&r2=1.18183 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sparc.c.diff?cvsroot=gcc&r1=1.243&r2=1.244 Subject: Bug 10142 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: ebotcazou@gcc.gnu.org 2003-06-13 04:07:18 Modified files: gcc : ChangeLog gcc/config/sparc: sparc.c Log message: PR target/10142 * config/sparc/sparc.c (function_arg_record_value_parms): Add new 'stack' field. (function_arg_record_value_1): Set 'stack' to 1 if we run out of integer slots for an integer field. (function_arg_record_value_3): Shift vector index. (function_arg_record_value_2): Likewise. (function_arg_record_value): Initialize 'stack' to 0. Set 'stack' to 1 if we run out of integer slots for an integer field. Generate (parallel [(expr_list (nil) ...) ...]) if 'stack' is set to 1. 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.576&r2=1.16114.2.577 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sparc.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.233.4.3&r2=1.233.4.4 |