Re: [Patch, Fortran] PR 54997: -Wunused-function gives false warnings for procedures passed as actual argument

2012-11-26 Thread Mikael Morin

Le 26/11/2012 12:21, Janus Weil a écrit :

2012/11/25 Mikael Morin:

Le 22/10/2012 16:49, Janus Weil a écrit :


Minor update to the patch: It now also sets TREE_USED for entry
masters in order to avoid bogus warnings for procedures with ENTRY
(cf. comment 6 in the PR, which like comment 0 is a 4.8 regression).

Still regtests cleanly. Ok?



OK with an extra test for comment 6.


Thanks a bunch. Committed as r193811. (A test for comment 6 was
already included in the updated test case I sent together with the
updated patch.)


Ah, yes, indeed. Didn't see it.


Re: [Patch, Fortran] PR 54997: -Wunused-function gives false warnings for procedures passed as actual argument

2012-11-26 Thread Janus Weil
2012/11/25 Mikael Morin :
> Le 22/10/2012 16:49, Janus Weil a écrit :
>
>> Minor update to the patch: It now also sets TREE_USED for entry
>> masters in order to avoid bogus warnings for procedures with ENTRY
>> (cf. comment 6 in the PR, which like comment 0 is a 4.8 regression).
>>
>> Still regtests cleanly. Ok?
>
>
> OK with an extra test for comment 6.

Thanks a bunch. Committed as r193811. (A test for comment 6 was
already included in the updated test case I sent together with the
updated patch.)


> Thanks. And sorry for the delay.

No reason to apologize! Better late than never ;)

Cheers,
Janus





>> 2012/10/21 Janus Weil:
>>>
>>> Hi all,
>>>
>>> here is another patch to silence some more of the bogus warnings about
>>> unused functions that gfortran is currently throwing (cf. also the
>>> previous patch for PR 54224).
>>>
>>> It fixes the usage of the 'referenced' attribute, which should only be
>>> given to procedures which are actually 'used' (called/referenced).
>>> Then TREE_USED is set according to this attribute, which in turn
>>> silences the warning in the middle-end.
>>>
>>> The patch was regtested on x86_64-unknown-linux-gnu. Ok for trunk?
>>>
>>> Cheers,
>>> Janus
>>>
>>>
>>> 2012-10-21  Janus Weil
>>>
>>>  PR fortran/54997
>>>  * decl.c (match_procedure_decl): Don't set 'referenced'
>>> attribute
>>>  for PROCEDURE declarations.
>>>  * parse.c (gfc_fixup_sibling_symbols,parse_contained): Don't set
>>>  'referenced' attribute for all contained procedures.
>>>  * trans-decl.c (gfc_get_symbol_decl): Allow for unreferenced
>>> procedures.
>>>  (build_function_decl): Set TREE_USED for referenced procedures.
>>>
>>> 2012-10-21  Janus Weil
>>>
>>>  PR fortran/54997
>>>  * gfortran.dg/warn_unused_function_2.f90: New.


Re: [Patch, Fortran] PR 54997: -Wunused-function gives false warnings for procedures passed as actual argument

2012-11-25 Thread Mikael Morin

Le 22/10/2012 16:49, Janus Weil a écrit :

Minor update to the patch: It now also sets TREE_USED for entry
masters in order to avoid bogus warnings for procedures with ENTRY
(cf. comment 6 in the PR, which like comment 0 is a 4.8 regression).

Still regtests cleanly. Ok?


OK with an extra test for comment 6.

Thanks. And sorry for the delay.

Mikael



Cheers,
Janus



2012/10/21 Janus Weil:

Hi all,

here is another patch to silence some more of the bogus warnings about
unused functions that gfortran is currently throwing (cf. also the
previous patch for PR 54224).

It fixes the usage of the 'referenced' attribute, which should only be
given to procedures which are actually 'used' (called/referenced).
Then TREE_USED is set according to this attribute, which in turn
silences the warning in the middle-end.

The patch was regtested on x86_64-unknown-linux-gnu. Ok for trunk?

Cheers,
Janus


2012-10-21  Janus Weil

 PR fortran/54997
 * decl.c (match_procedure_decl): Don't set 'referenced' attribute
 for PROCEDURE declarations.
 * parse.c (gfc_fixup_sibling_symbols,parse_contained): Don't set
 'referenced' attribute for all contained procedures.
 * trans-decl.c (gfc_get_symbol_decl): Allow for unreferenced 
procedures.
 (build_function_decl): Set TREE_USED for referenced procedures.

2012-10-21  Janus Weil

 PR fortran/54997
 * gfortran.dg/warn_unused_function_2.f90: New.


Re: [Patch, Fortran] PR 54997: -Wunused-function gives false warnings for procedures passed as actual argument

2012-10-29 Thread Janus Weil
ping!


2012/10/22 Janus Weil :
> Minor update to the patch: It now also sets TREE_USED for entry
> masters in order to avoid bogus warnings for procedures with ENTRY
> (cf. comment 6 in the PR, which like comment 0 is a 4.8 regression).
>
> Still regtests cleanly. Ok?
>
> Cheers,
> Janus
>
>
>
> 2012/10/21 Janus Weil :
>> Hi all,
>>
>> here is another patch to silence some more of the bogus warnings about
>> unused functions that gfortran is currently throwing (cf. also the
>> previous patch for PR 54224).
>>
>> It fixes the usage of the 'referenced' attribute, which should only be
>> given to procedures which are actually 'used' (called/referenced).
>> Then TREE_USED is set according to this attribute, which in turn
>> silences the warning in the middle-end.
>>
>> The patch was regtested on x86_64-unknown-linux-gnu. Ok for trunk?
>>
>> Cheers,
>> Janus
>>
>>
>> 2012-10-21  Janus Weil  
>>
>> PR fortran/54997
>> * decl.c (match_procedure_decl): Don't set 'referenced' attribute
>> for PROCEDURE declarations.
>> * parse.c (gfc_fixup_sibling_symbols,parse_contained): Don't set
>> 'referenced' attribute for all contained procedures.
>> * trans-decl.c (gfc_get_symbol_decl): Allow for unreferenced 
>> procedures.
>> (build_function_decl): Set TREE_USED for referenced procedures.
>>
>> 2012-10-21  Janus Weil  
>>
>> PR fortran/54997
>> * gfortran.dg/warn_unused_function_2.f90: New.


Re: [Patch, Fortran] PR 54997: -Wunused-function gives false warnings for procedures passed as actual argument

2012-10-22 Thread Janus Weil
Minor update to the patch: It now also sets TREE_USED for entry
masters in order to avoid bogus warnings for procedures with ENTRY
(cf. comment 6 in the PR, which like comment 0 is a 4.8 regression).

Still regtests cleanly. Ok?

Cheers,
Janus



2012/10/21 Janus Weil :
> Hi all,
>
> here is another patch to silence some more of the bogus warnings about
> unused functions that gfortran is currently throwing (cf. also the
> previous patch for PR 54224).
>
> It fixes the usage of the 'referenced' attribute, which should only be
> given to procedures which are actually 'used' (called/referenced).
> Then TREE_USED is set according to this attribute, which in turn
> silences the warning in the middle-end.
>
> The patch was regtested on x86_64-unknown-linux-gnu. Ok for trunk?
>
> Cheers,
> Janus
>
>
> 2012-10-21  Janus Weil  
>
> PR fortran/54997
> * decl.c (match_procedure_decl): Don't set 'referenced' attribute
> for PROCEDURE declarations.
> * parse.c (gfc_fixup_sibling_symbols,parse_contained): Don't set
> 'referenced' attribute for all contained procedures.
> * trans-decl.c (gfc_get_symbol_decl): Allow for unreferenced 
> procedures.
> (build_function_decl): Set TREE_USED for referenced procedures.
>
> 2012-10-21  Janus Weil  
>
> PR fortran/54997
> * gfortran.dg/warn_unused_function_2.f90: New.


warn_unused_function_2.f90
Description: Binary data


pr54997_v2.diff
Description: Binary data