This is the mail archive of the 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: [PATCH 1/4] Support lambda templates.

On 02.09.2013 19:34, Jason Merrill wrote:
On 09/02/2013 02:30 PM, Adam Butcher wrote:
On 01.09.2013 21:22, Jason Merrill wrote:
I bet we want convert_from_reference in the non-generic lambda case, too.

I think I had made that change originally to keep the two impls the same
and I hit issues with non-generic lambdas.  But I can't remember the
details.  I'll try again.

Okay, finally got around to trying this again. With convert_from_reference in the non-generic case, the code compiles okay but SEGVs on the attempt to branch to '_FUN'.

  â105       auto lf0 = [] (float& a, int const& b) { return a += b; };
  â107       INVOKEi (lf, float, 7, 0);
 >â108       AS_FUNi (lf, float, 7, 0);
  â109       AS_PTRi (lf, float, int, 7, 0);

  â0x404500 <main()+14687> mov    %eax,-0x4bc(%rbp)
  â0x404506 <main()+14693> mov    0x36f0(%rip),%eax        # 0x407bfc
  â0x40450c <main()+14699> mov    %eax,-0x4c0(%rbp)
  â0x404512 <main()+14705> movl   $0x7,-0x2a4(%rbp)
  â0x40451c <main()+14715> lea    -0x2a4(%rbp),%rdx
  â0x404523 <main()+14722> lea    -0x4bc(%rbp),%rax
  â0x40452a <main()+14729> mov    %rdx,%rsi
  â0x40452d <main()+14732> mov    %rax,%rdi
>â0x404530 <main()+14735> callq 0x400934 <<lambda(float&, int const&)>::_FUN(float &, const int &)>

If it works with convert_from_reference in
both cases should I push or should I sort out the parameter pack
conversion op issue and roll that up into this?

I think roll them together, since that patch rewrites parts of this one.

Will assume, for now, that the convert_from_reference call is not wanted in the non-generic case (maybe something to do with using 'build_call_a' instead of 'build_nt_call_vec' or the convert_from_reference on the call itself?) and will focus on the parameter pack stuff (when I get a chance).


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