Re: Postpone expanding va_arg until pass_stdarg

2015-02-16 Thread Tom de Vries
On 12-02-15 23:51, Tom de Vries wrote: On 12-02-15 14:57, Michael Matz wrote: I'm not really sure yet why std_gimplify_va_arg_expr has a part commented out. Michael, can you comment? I think I did that because of SSA form. The old sequence calculated vatmp = valist; vatmp = vatmp +

Re: Postpone expanding va_arg until pass_stdarg

2015-02-13 Thread Richard Biener
On February 13, 2015 10:40:17 PM CET, Tom de Vries wrote: >On 13-02-15 09:57, Richard Biener wrote: >>> [ We're still expanding ifn_va_arg before the va_list_gpr/fpr_size >>> >optimization. ] >> Yeah, and the point of the exercise was of course to change that;) > >Well, there are two parts. > >Th

Re: Postpone expanding va_arg until pass_stdarg

2015-02-13 Thread Tom de Vries
On 13-02-15 09:57, Richard Biener wrote: [ We're still expanding ifn_va_arg before the va_list_gpr/fpr_size >optimization. ] Yeah, and the point of the exercise was of course to change that;) Well, there are two parts. The first is postpone expansion of va_arg to before the va_list_gpr/fpr_si

Re: Postpone expanding va_arg until pass_stdarg

2015-02-13 Thread Richard Biener
On Thu, Feb 12, 2015 at 11:51 PM, Tom de Vries wrote: > On 12-02-15 14:57, Michael Matz wrote: >> >> Hi, >> >> On Wed, 11 Feb 2015, Tom de Vries wrote: >> My idea was to not generate temporaries and hence copies for non-scalar types, but rather construct the "result" of va_arg directly >

Re: Postpone expanding va_arg until pass_stdarg

2015-02-12 Thread Tom de Vries
On 12-02-15 14:57, Michael Matz wrote: Hi, On Wed, 11 Feb 2015, Tom de Vries wrote: My idea was to not generate temporaries and hence copies for non-scalar types, but rather construct the "result" of va_arg directly into the original LHS (that would then also trivially solve the problem of nno

Re: Postpone expanding va_arg until pass_stdarg

2015-02-12 Thread Michael Matz
Hi, On Wed, 11 Feb 2015, Tom de Vries wrote: > > My idea was to not generate temporaries and hence copies for > > non-scalar types, but rather construct the "result" of va_arg directly > > into the original LHS (that would then also trivially solve the > > problem of nno-copyable types). > >

Re: Postpone expanding va_arg until pass_stdarg

2015-02-11 Thread Tom de Vries
On 10-02-15 14:46, Richard Biener wrote: This patch is a way to achieve that gimplification doesn't call the actual >gimplify_expr langhook, and it fixes the failure. But I'm guessing that's >not the proper way to fix this. More like Index: gcc/tree.c ===

Re: Postpone expanding va_arg until pass_stdarg

2015-02-11 Thread Tom de Vries
On 10-02-15 17:57, Michael Matz wrote: Hi, On Tue, 10 Feb 2015, Tom de Vries wrote: I've added two modifications to gimplify_modify_expr: - the WITH_SIZE_EXPR in which the CALL_TREE is wrapped, is dropped after gimplification, but we need the size expression at expansion in pass_stdarg.

Re: Postpone expanding va_arg until pass_stdarg

2015-02-10 Thread Michael Matz
Hi, On Tue, 10 Feb 2015, Tom de Vries wrote: > I've added two modifications to gimplify_modify_expr: > - the WITH_SIZE_EXPR in which the CALL_TREE is wrapped, is dropped after > gimplification, but we need the size expression at expansion in pass_stdarg. > So I added the size expression as ar

Re: Postpone expanding va_arg until pass_stdarg

2015-02-10 Thread Richard Biener
On Tue, Feb 10, 2015 at 2:20 PM, Tom de Vries wrote: > On 10-02-15 11:10, Richard Biener wrote: >>> >>> The single failing testcase (both with and without -m32) is >>> >g++.dg/torture/pr45843.C: >>> >... >>> >./gcc/testsuite/g++/g++.sum:FAIL: g++.dg/torture/pr45843.C -O2 -flto >>> >-fno-use-link

Re: Postpone expanding va_arg until pass_stdarg

2015-02-10 Thread Tom de Vries
On 10-02-15 11:10, Richard Biener wrote: The single failing testcase (both with and without -m32) is >g++.dg/torture/pr45843.C: >... >./gcc/testsuite/g++/g++.sum:FAIL: g++.dg/torture/pr45843.C -O2 -flto >-fno-use-linker-plugin -flto-partition=none (internal compiler error) >... > >The failure

Re: Postpone expanding va_arg until pass_stdarg

2015-02-10 Thread Richard Biener
On Tue, Feb 10, 2015 at 10:22 AM, Tom de Vries wrote: > [ was: Re: pass_stdarg problem when run after pass_lim ] > > On 03-02-15 14:36, Michael Matz wrote: >> >> Hi, >> >> On Tue, 3 Feb 2015, Tom de Vries wrote: >> >>> Ironically, that fix breaks the va_list_gpr/fpr_size optimization, so >>> I've

Postpone expanding va_arg until pass_stdarg

2015-02-10 Thread Tom de Vries
.. The segfault happens because we're calling is_really_empty_class for struct S, and TYPE_BINFO is NULL_TREE, which causes BINFO_BASE_ITERATE to segfault. I'm not sure yet what this issue is or how this is supposed to be fixed. Thanks, - Tom Postpone expanding va_ar