[Patch/cfgexpand]: also consider assembler_name to call expand_main_function

2012-03-14 Thread Tristan Gingold
Hi, the code to call expand_main_function currently only checks DECL_NAME. This leads to a hack in ada/gcc-interface/utils.c to handle the gnatbind generated file that could declare: package ada_main is … function my_main (argc : Integer; argv : System.Address; envp : Syste

Re: [Patch/cfgexpand]: also consider assembler_name to call expand_main_function

2012-03-14 Thread Richard Guenther
On Wed, 14 Mar 2012, Tristan Gingold wrote: > Hi, > > the code to call expand_main_function currently only checks DECL_NAME. This > leads > to a hack in ada/gcc-interface/utils.c to handle the gnatbind generated file > that could > declare: > > package ada_main is > … >function my_main >

Re: [Patch/cfgexpand]: also consider assembler_name to call expand_main_function

2012-03-14 Thread Tristan Gingold
On Mar 14, 2012, at 5:08 PM, Richard Guenther wrote: > On Wed, 14 Mar 2012, Tristan Gingold wrote: > >> Hi, >> >> the code to call expand_main_function currently only checks DECL_NAME. This >> leads >> to a hack in ada/gcc-interface/utils.c to handle the gnatbind generated file >> that could

Re: [Patch/cfgexpand]: also consider assembler_name to call expand_main_function

2012-03-15 Thread Richard Guenther
On Wed, 14 Mar 2012, Tristan Gingold wrote: > > On Mar 14, 2012, at 5:08 PM, Richard Guenther wrote: > > > On Wed, 14 Mar 2012, Tristan Gingold wrote: > > > >> Hi, > >> > >> the code to call expand_main_function currently only checks DECL_NAME. > >> This leads > >> to a hack in ada/gcc-inter

Re: [Patch/cfgexpand]: also consider assembler_name to call expand_main_function

2012-03-15 Thread Tristan Gingold
On Mar 15, 2012, at 10:37 AM, Richard Guenther wrote: > On Wed, 14 Mar 2012, Tristan Gingold wrote: > >> >> On Mar 14, 2012, at 5:08 PM, Richard Guenther wrote: >> >>> On Wed, 14 Mar 2012, Tristan Gingold wrote: >>> Hi, the code to call expand_main_function currently only chec

Re: [Patch/cfgexpand]: also consider assembler_name to call expand_main_function

2012-03-20 Thread Tristan Gingold
On Mar 15, 2012, at 10:37 AM, Richard Guenther wrote: > On Wed, 14 Mar 2012, Tristan Gingold wrote: […] > > Well. To make this work in LTO the "main" function (thus, the program > entry point) should be marked at cgraph level and all users of > MAIN_NAME_P should instead check a flag on the cg

Re: [Patch/cfgexpand]: also consider assembler_name to call expand_main_function

2012-03-20 Thread Richard Guenther
On Tue, 20 Mar 2012, Tristan Gingold wrote: > > On Mar 15, 2012, at 10:37 AM, Richard Guenther wrote: > > > On Wed, 14 Mar 2012, Tristan Gingold wrote: > […] > > > > > Well. To make this work in LTO the "main" function (thus, the program > > entry point) should be marked at cgraph level and a

Re: [Patch/cfgexpand]: also consider assembler_name to call expand_main_function

2012-03-20 Thread Tristan Gingold
On Mar 20, 2012, at 1:21 PM, Richard Guenther wrote: > On Tue, 20 Mar 2012, Tristan Gingold wrote: > >> >> On Mar 15, 2012, at 10:37 AM, Richard Guenther wrote: >> >>> On Wed, 14 Mar 2012, Tristan Gingold wrote: >> […] >> >>> >>> Well. To make this work in LTO the "main" function (thus, the

Re: [Patch/cfgexpand]: also consider assembler_name to call expand_main_function

2012-03-20 Thread Richard Guenther
On Tue, 20 Mar 2012, Tristan Gingold wrote: > > On Mar 20, 2012, at 1:21 PM, Richard Guenther wrote: > > > On Tue, 20 Mar 2012, Tristan Gingold wrote: > > > >> > >> On Mar 15, 2012, at 10:37 AM, Richard Guenther wrote: > >> > >>> On Wed, 14 Mar 2012, Tristan Gingold wrote: > >> […] > >> > >>

Re: [Patch/cfgexpand]: also consider assembler_name to call expand_main_function

2012-03-20 Thread Tristan Gingold
On Mar 20, 2012, at 3:19 PM, Richard Guenther wrote: […] > > I'd rather get away from using a global main_identifier_node, instead > make that frontend specific, and introduce targetm.main_assembler_name > which the assembler-name creating langhook would make sure to use > when mangling what the

Re: [Patch/cfgexpand]: also consider assembler_name to call expand_main_function

2012-03-20 Thread Richard Guenther
On Tue, 20 Mar 2012, Tristan Gingold wrote: > > On Mar 20, 2012, at 3:19 PM, Richard Guenther wrote: > > […] > > > > I'd rather get away from using a global main_identifier_node, instead > > make that frontend specific, and introduce targetm.main_assembler_name > > which the assembler-name crea

Re: [Patch/cfgexpand]: also consider assembler_name to call expand_main_function

2012-03-20 Thread Tristan Gingold
On Mar 20, 2012, at 5:01 PM, Richard Guenther wrote: > On Tue, 20 Mar 2012, Tristan Gingold wrote: > >> >> On Mar 20, 2012, at 3:19 PM, Richard Guenther wrote: >> >> […] >>> >>> I'd rather get away from using a global main_identifier_node, instead >>> make that frontend specific, and introduc

Re: [Patch/cfgexpand]: also consider assembler_name to call expand_main_function

2012-03-20 Thread Jan Hubicka
> On Tue, 20 Mar 2012, Tristan Gingold wrote: > > > > > On Mar 15, 2012, at 10:37 AM, Richard Guenther wrote: > > > > > On Wed, 14 Mar 2012, Tristan Gingold wrote: > > [?] > > > > > > > > Well. To make this work in LTO the "main" function (thus, the program > > > entry point) should be marked

Re: [Patch/cfgexpand]: also consider assembler_name to call expand_main_function

2012-03-21 Thread Richard Guenther
On Tue, 20 Mar 2012, Tristan Gingold wrote: > > On Mar 20, 2012, at 5:01 PM, Richard Guenther wrote: > > > On Tue, 20 Mar 2012, Tristan Gingold wrote: > > > >> > >> On Mar 20, 2012, at 3:19 PM, Richard Guenther wrote: > >> > >> [...] > >>> > >>> I'd rather get away from using a global main_i

Re: [Patch/cfgexpand]: also consider assembler_name to call expand_main_function

2012-03-21 Thread Tristan Gingold
On Mar 20, 2012, at 6:17 PM, Jan Hubicka wrote: >> On Tue, 20 Mar 2012, Tristan Gingold wrote: >> >>> >>> On Mar 15, 2012, at 10:37 AM, Richard Guenther wrote: >>> On Wed, 14 Mar 2012, Tristan Gingold wrote: >>> [?] >>> Well. To make this work in LTO the "main" function (thus