Re: [PATCH][PR66010] Don't take address of ap unless necessary

2015-05-18 Thread Richard Biener
On Thu, 14 May 2015, Tom de Vries wrote: > On 12-05-15 12:04, Richard Biener wrote: > > > The fact that we have to handle this specially in both build_va_arg and > > > >gimplify_va_arg makes me wonder whether we should be dealing with all > > > this in > > > >build_va_arg already. > > > > > > > >T

Re: [PATCH][PR66010] Don't take address of ap unless necessary

2015-05-14 Thread Tom de Vries
On 12-05-15 12:04, Richard Biener wrote: The fact that we have to handle this specially in both build_va_arg and >gimplify_va_arg makes me wonder whether we should be dealing with all this in >build_va_arg already. > >That is, determine whether we take the address, and add the address operator >i

Re: [PATCH][PR66010] Don't take address of ap unless necessary

2015-05-13 Thread Richard Biener
On Wed, 13 May 2015, Andreas Krebbel wrote: > On 05/12/2015 01:45 PM, Tom de Vries wrote: > > On 12-05-15 12:04, Tom de Vries wrote: > >> Committed with comments below added. > > > > Hmm, this causes an ice for s390 in gcc.dg/tree-ssa/stdarg-2.c: > > ... > > gimplification failed: > > &ap >

Re: [PATCH][PR66010] Don't take address of ap unless necessary

2015-05-12 Thread Andreas Krebbel
On 05/12/2015 01:45 PM, Tom de Vries wrote: > On 12-05-15 12:04, Tom de Vries wrote: >> Committed with comments below added. > > Hmm, this causes an ice for s390 in gcc.dg/tree-ssa/stdarg-2.c: > ... > gimplification failed: > &ap type type 0x7f132f46b888 __va_list_tag> >

Re: [PATCH][PR66010] Don't take address of ap unless necessary

2015-05-12 Thread Pat Haugen
On 05/12/2015 06:45 AM, Tom de Vries wrote: Hmm, this causes an ice for s390 in gcc.dg/tree-ssa/stdarg-2.c: ... gimplification failed: &ap type 0x7f132f46b888 __va_list_tag> sizes-gimplified BLK size unit size align 32 symtab 0 alias set

Re: [PATCH][PR66010] Don't take address of ap unless necessary

2015-05-12 Thread Tom de Vries
On 12-05-15 12:04, Tom de Vries wrote: Committed with comments below added. Hmm, this causes an ice for s390 in gcc.dg/tree-ssa/stdarg-2.c: ... gimplification failed: &ap type 0x7f132f46b888 __va_list_tag> sizes-gimplified BLK size unit size

Re: [PATCH][PR66010] Don't take address of ap unless necessary

2015-05-12 Thread Tom de Vries
On 12-05-15 12:12, Michael Matz wrote: Hi, On Fri, 8 May 2015, Tom de Vries wrote: III. Using the patch, before inlining we can see the address operator has been removed in va_arg: ... f2_1 (struct * apD.1832) { intD.6 _4; # .MEM_3 = VDEF <.MEM_1(D)> # USE = anything # CLB = any

Re: [PATCH][PR66010] Don't take address of ap unless necessary

2015-05-12 Thread Michael Matz
Hi, On Fri, 8 May 2015, Tom de Vries wrote: > III. > > Using the patch, before inlining we can see the address operator has been > removed in va_arg: > ... > f2_1 (struct * apD.1832) > { > intD.6 _4; > > # .MEM_3 = VDEF <.MEM_1(D)> > # USE = anything > # CLB = anything > > _4 = VA_A

Re: [PATCH][PR66010] Don't take address of ap unless necessary

2015-05-12 Thread Richard Biener
On Tue, 12 May 2015, Tom de Vries wrote: > On 12-05-15 09:45, Richard Biener wrote: > > On Mon, 11 May 2015, Tom de Vries wrote: > > > > > On 11-05-15 09:47, Richard Biener wrote: > > > > > Bootstrapped and reg-tested on x86_64, with and without -m32. > > > > > > > > > > > > OK for trunk? > > >

Re: [PATCH][PR66010] Don't take address of ap unless necessary

2015-05-12 Thread Tom de Vries
On 12-05-15 09:45, Richard Biener wrote: On Mon, 11 May 2015, Tom de Vries wrote: On 11-05-15 09:47, Richard Biener wrote: Bootstrapped and reg-tested on x86_64, with and without -m32. OK for trunk? [ FWIW, I suspect this patch will make life easier for the reimplementation of the pass_st

Re: [PATCH][PR66010] Don't take address of ap unless necessary

2015-05-12 Thread Richard Biener
On Mon, 11 May 2015, Tom de Vries wrote: > On 11-05-15 09:47, Richard Biener wrote: > > > Bootstrapped and reg-tested on x86_64, with and without -m32. > > > > > > > >OK for trunk? > > > > > > > >[ FWIW, I suspect this patch will make life easier for the > > > reimplementation of > > > >the pass_s

Re: [PATCH][PR66010] Don't take address of ap unless necessary

2015-05-11 Thread Tom de Vries
On 11-05-15 09:47, Richard Biener wrote: Bootstrapped and reg-tested on x86_64, with and without -m32. > >OK for trunk? > >[ FWIW, I suspect this patch will make life easier for the reimplementation of >the pass_stdarg optimization using ifn_va_arg. ] + if (canon_va_type != NULL) +{ +

Re: [PATCH][PR66010] Don't take address of ap unless necessary

2015-05-11 Thread Richard Biener
On Fri, 8 May 2015, Tom de Vries wrote: > Hi, > > this patch fixes PR66010. > > > I. > > Consider this test-case, with a va_list passed from f2 to f2_1: > ... > #include > > inline int __attribute__((always_inline)) > f2_1 (va_list ap) > { > return va_arg (ap, int); > } > > int > f2 (int

[PATCH][PR66010] Don't take address of ap unless necessary

2015-05-08 Thread Tom de Vries
Hi, this patch fixes PR66010. I. Consider this test-case, with a va_list passed from f2 to f2_1: ... #include inline int __attribute__((always_inline)) f2_1 (va_list ap) { return va_arg (ap, int); } int f2 (int i, ...) { int res; va_list ap; va_start (ap, i); res = f2_1 (ap); v