This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ pcc struct return fix


> >>>>> "John" == John David Anglin <dave@hiauly1.hia.nrc.ca> writes:
> 
> > 	* semantics.c (simplify_aggr_init_exprs_r): Add DIRECT_BIND flag in
> > 	call to build_aggr_init.
> 
> DIRECT_BIND is for binding temporaries to reference variables; I'm not sure
> why this would have any effect on your problem.  Perhaps rather than call
> build_aggr_init here, we should be doing an explicit constructor call as in
> ocp_convert.

It is a while since I looked at this problem but roughly what happens is
that build_aggr_init calls ocp_convert which calls simplify_aggr_init_exprs_r
which calls build_aggr_init which calls ...  Look at expand_default_init.
I think this is why DIRECT_BIND has an affect.

I do know that the code generated for function returning a struct seemed
reasonable when DIRECT_BIND was added to the flags in the call.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]