1 Jun 2009 03:10
Re: Different FUNC_DECLS with the same DECL_NAME - MAIN__ and named PROGRAM main functions [was Re: gcc-4.5-20090528 is now available]
Jerry DeLisle <jvdelisle <at> verizon.net>
2009-06-01 01:10:02 GMT
2009-06-01 01:10:02 GMT
Tobias Burnus wrote:
> Dave Korn wrote:
>> Dave Korn wrote:
>>> Dave Korn wrote:
>>>> Tobias Burnus wrote:
>>>>> I agree that for "main" the call to "__main()" should happend and thus
>>>>> expand_main_function should be called. I'm not sure in about the exact
>>>>> assumptions of the middle end. In principle, it would be OK if the
>>>>> MAIN__ function would show up as MAIN__ in gimple/-fdump-tree-original.
>>>>> The only potential inconvenience I see, is the mentioned reference to
>>>>> MAIN__ instead of <program name> in middle-end warnings, which can
>>>>> confuse users.
>> Is it legitimate to have a space in an IDENTIFIER_NODE? I have a cheeky idea:
>
>> - gfc_get_symbol (name, ns, &main_program);
>> + identifier = gfc_get_string ("PROGRAM %s", name);
>
>> That should give reasonable warnings from the middle end, no? I don't know
>> what it might do to debugging though.
>
> Currently one can use "b MAIN__" and "b helloworld" in the debugger:
>
> (gdb) b helloworld
> Breakpoint 1 at 0x400737: file test.f90, line 3.
> (gdb) b MAIN__
> Note: breakpoint 1 also set at pc 0x400737.
> Breakpoint 2 at 0x400737: file test.f90, line 3.
> (gdb) b main
> Breakpoint 3 at 0x4007b9: file test.f90, line 9.
>
(Continue reading)
RSS Feed