This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/38366] gcc doesn't call functions that are struct arguments correctly
- From: "ktietz at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Dec 2008 11:37:14 -0000
- Subject: [Bug target/38366] gcc doesn't call functions that are struct arguments correctly
- References: <bug-38366-13013@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from ktietz at gcc dot gnu dot org 2008-12-02 11:37 -------
Created an attachment (id=16809)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16809&action=view)
Patch file
I can reproduce it and the patch here should solve it.
The main reason is in i386 target ix86_reg_parm_stack_space(), which defaults
for NULL_TREE fndecl to cfun, which is wrong in this context.
Additionally init_cumulative_args() should verify first the fndecl and just
when not present the fntype.
In middle-end there is compute_argument_addresses() (calls.c), which needs as
fallback the fntype passed for proper call of aggregate_value_p().
The part in function.c could be superflous.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38366