This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Question about -Wuninitialized
On Tue, Jul 25, 2006 at 07:22:52AM -0700, Steve Kargl wrote:
>On Tue, Jul 25, 2006 at 02:41:12PM +0200, Salvatore Filippone wrote:
>> Hi there,
>> First let me say that -Wuninitialized and -Wunused are really great
>> tools.
>>
>> However (you guessed there was an issue, didn't you?) I would be
>> grateful to anybody who can illuminate me on the following.
>>
>> I have a small sample attached, and it generates the output shown below.
>> Two questions:
>>
>> 1. Why is the compiler warning about "ia.0" potentially uninitialized?
>> At first sight, this seems to be related to the IA(:) variable, which is
>> declared INOUT, so I don't understand why it should be initialized. Or
>> is it about something else? Moreover, it looks like a case simple enough
>> to figure out that IA is only used if present, so no need for "May be"
>> (but maybe I am wrong?)
>>
>> 2. Why does the compiler complain about stride.1 and ubound.0 which are
>> not visible to the user? I figure they are variables internal to the
>> descriptors for allocatable arrays, they should be reported under the
>> array variable name...
>
>These options are common to the gcc middle and/or backend.
>The checks are done after after gfortran has generated
>GIMPLE. It may be possible to mark these symbols with
>something like the gccism of ATTRIBUTE_UNUSED, but I haven't
>investigates the problem.
That'd be TREE_NO_WARNING for ARTIFICIAL decls, i guess.
I don't know if DECL_ARTIFICIAL should have an SSA_NAME at all, though.