Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function

2012-08-24 Thread Martin Jambor
Hi, On Wed, Aug 22, 2012 at 03:37:48PM +0200, Richard Guenther wrote: On Wed, Aug 22, 2012 at 3:04 PM, Martin Jambor mjam...@suse.cz wrote: On Tue, Aug 21, 2012 at 01:30:47PM +0200, Richard Guenther wrote: On Tue, Aug 21, 2012 at 1:27 PM, Martin Jambor mjam...@suse.cz wrote: On Wed, Aug

Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function

2012-08-22 Thread Martin Jambor
Hi, On Tue, Aug 21, 2012 at 01:30:47PM +0200, Richard Guenther wrote: On Tue, Aug 21, 2012 at 1:27 PM, Martin Jambor mjam...@suse.cz wrote: On Wed, Aug 15, 2012 at 05:21:04PM +0200, Martin Jambor wrote: Hi, On Fri, Aug 10, 2012 at 04:57:41PM +0200, Eric Botcazou wrote: -

Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function

2012-08-22 Thread Richard Guenther
On Wed, Aug 22, 2012 at 3:04 PM, Martin Jambor mjam...@suse.cz wrote: Hi, On Tue, Aug 21, 2012 at 01:30:47PM +0200, Richard Guenther wrote: On Tue, Aug 21, 2012 at 1:27 PM, Martin Jambor mjam...@suse.cz wrote: On Wed, Aug 15, 2012 at 05:21:04PM +0200, Martin Jambor wrote: Hi, On Fri,

Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function

2012-08-21 Thread Martin Jambor
On Wed, Aug 15, 2012 at 05:21:04PM +0200, Martin Jambor wrote: Hi, On Fri, Aug 10, 2012 at 04:57:41PM +0200, Eric Botcazou wrote: - ada/gcc-interface/utils.c:rest_of_subprog_body_compilation calls dump_function which in turns calls dump_function_to_file which calls push_cfun. But

Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function

2012-08-21 Thread Richard Guenther
On Tue, Aug 21, 2012 at 1:27 PM, Martin Jambor mjam...@suse.cz wrote: On Wed, Aug 15, 2012 at 05:21:04PM +0200, Martin Jambor wrote: Hi, On Fri, Aug 10, 2012 at 04:57:41PM +0200, Eric Botcazou wrote: - ada/gcc-interface/utils.c:rest_of_subprog_body_compilation calls dump_function which

Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function

2012-08-16 Thread Richard Guenther
On Wed, Aug 15, 2012 at 5:21 PM, Martin Jambor mjam...@suse.cz wrote: Hi, On Fri, Aug 10, 2012 at 04:57:41PM +0200, Eric Botcazou wrote: - ada/gcc-interface/utils.c:rest_of_subprog_body_compilation calls dump_function which in turns calls dump_function_to_file which calls push_cfun.

Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function

2012-08-16 Thread Michael Matz
Hi, On Thu, 16 Aug 2012, Richard Guenther wrote: If dumping a statement needs the containing function then we need to either pass that down, provide a way to get from statement to function, or stop requiring the function. Making the hash global is choice three (deallocating the hash

Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function

2012-08-16 Thread Diego Novillo
On Thu, Aug 16, 2012 at 8:40 AM, Michael Matz m...@suse.de wrote: Hi, On Thu, 16 Aug 2012, Richard Guenther wrote: If dumping a statement needs the containing function then we need to either pass that down, provide a way to get from statement to function, or stop requiring the function.

Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function

2012-08-16 Thread Michael Matz
Hi, On Thu, 16 Aug 2012, Diego Novillo wrote: I like this approach, particularly since it would be used in contexts where there is no simpler scheme. I'm not crazy about overloading unused fields, but it's fine if we wrap it around a special accessor. I suppose we could also make

Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function

2012-08-16 Thread Diego Novillo
On Thu, Aug 16, 2012 at 10:21 AM, Michael Matz m...@suse.de wrote: Hi, On Thu, 16 Aug 2012, Diego Novillo wrote: I like this approach, particularly since it would be used in contexts where there is no simpler scheme. I'm not crazy about overloading unused fields, but it's fine if we wrap

Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function

2012-08-15 Thread Martin Jambor
Hi, On Fri, Aug 10, 2012 at 04:57:41PM +0200, Eric Botcazou wrote: - ada/gcc-interface/utils.c:rest_of_subprog_body_compilation calls dump_function which in turns calls dump_function_to_file which calls push_cfun. But Ada front end has its idea of the current_function_decl and

Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function

2012-08-10 Thread Eric Botcazou
- ada/gcc-interface/utils.c:rest_of_subprog_body_compilation calls dump_function which in turns calls dump_function_to_file which calls push_cfun. But Ada front end has its idea of the current_function_decl and there is no cfun which is an inconsistency which makes push_cfun assert

Re: [PATCH] Set current_function_decl in {push,pop}_cfun and push_struct_function

2012-08-09 Thread Richard Guenther
On Thu, Aug 9, 2012 at 4:26 PM, Martin Jambor mjam...@suse.cz wrote: Hi, I've always found it silly that in order to change the current function one has to call push_cfun and pop_cfun which conveniently set and restore the value of cfun and in addition to that also set current_function_decl