This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, tree-ssa] Avoid -Wuninitialized warning in try_unroll_loop_completely()


2013/4/15 Jeff Law <law@redhat.com>:
> On 04/13/2013 07:17 PM, Chung-Ju Wu wrote:
>>
>> Hi,
>>
>> I noticed there is an uninitialized variable warning
>> when compiling tree-ssa-loop-ivcanon.c file.
>>
>> Attached patch is a slight modification to avoid the warning
>> and a plaintext ChangeLog is as below.
>>
>> Is it OK for trunk?
>>
>>
>> 2013-04-14  Chung-Ju Wu  <jasonwucj@gmail.com>
>>
>>          * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Avoid
>>          -Wuninitialized warning.
>
> If this is a false positive (and I think it is from a very quick scan of the
> code), can you mark the initialization as such?
>
> /* Avoid false positive -Wuninitialized warning.  */
>
> Ideally this will become standard practice.
>
> jeff

You are right.
After doing survey on http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings
and reading related discussion thread, I realized it is a
complicated detection and this is a false positive case.

I was using gcc-4.6.3, which is provided by Ubuntu 12.04,
and the warning is displayed during the compilation process.
As I tried to build another native gcc by myself with
current main trunk and used it to compile tree-ssa-loop-ivcanon.c again,
there is no such warning at all.
(See attachment for my console output.)

So I am wondering if my patch is still valuable since
such false positive warning is already fixed on trunk.

Or do you think it is still good having the comment in the patch
and then OK to commit it? :)


Best regards,
jasonwucj

Attachment: console-output.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]