public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: [PATCH] Fix uninitialised variable warning in tree-ssa-loop-ivcanon.c
@ 2014-04-17 17:08 Daniel Marjamäki
  2014-04-22  8:10 ` Kyrill Tkachov
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Marjamäki @ 2014-04-17 17:08 UTC (permalink / raw)
  To: kyrylo.tkachov; +Cc: gcc-patches

Hello!

I am not against it..

However I think there is no danger. I see no potential use of
uninitialized variable.

The use of n_unroll is guarded by n_unroll_found.

Best regards,
Daniel Marjamäki

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix uninitialised variable warning in tree-ssa-loop-ivcanon.c
  2014-04-17 17:08 [PATCH] Fix uninitialised variable warning in tree-ssa-loop-ivcanon.c Daniel Marjamäki
@ 2014-04-22  8:10 ` Kyrill Tkachov
  2014-04-22  8:42   ` Richard Biener
  0 siblings, 1 reply; 5+ messages in thread
From: Kyrill Tkachov @ 2014-04-22  8:10 UTC (permalink / raw)
  To: Daniel Marjamäki; +Cc: gcc-patches

On 17/04/14 18:06, Daniel Marjamäki wrote:
> Hello!
>
> I am not against it..
>
> However I think there is no danger. I see no potential use of
> uninitialized variable.
>
> The use of n_unroll is guarded by n_unroll_found.

Hmmm... you're right. I guess the warning is just noise then.
I'll leave it up to maintainers to take the patch or not then.

Thanks,
Kyrill

>
> Best regards,
> Daniel Marjamäki
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix uninitialised variable warning in tree-ssa-loop-ivcanon.c
  2014-04-22  8:10 ` Kyrill Tkachov
@ 2014-04-22  8:42   ` Richard Biener
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Biener @ 2014-04-22  8:42 UTC (permalink / raw)
  To: Kyrill Tkachov; +Cc: Daniel Marjamäki, gcc-patches

On Tue, Apr 22, 2014 at 10:07 AM, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:
> On 17/04/14 18:06, Daniel Marjamäki wrote:
>>
>> Hello!
>>
>> I am not against it..
>>
>> However I think there is no danger. I see no potential use of
>> uninitialized variable.
>>
>> The use of n_unroll is guarded by n_unroll_found.
>
>
> Hmmm... you're right. I guess the warning is just noise then.
> I'll leave it up to maintainers to take the patch or not then.

If it only appears with the host compiler (not during bootstrap, in which
case it would break bootstrap) then we don't want it.

Richard.

> Thanks,
> Kyrill
>
>>
>> Best regards,
>> Daniel Marjamäki
>>
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix uninitialised variable warning in tree-ssa-loop-ivcanon.c
  2014-04-17 16:45 Kyrill Tkachov
@ 2014-05-09 19:36 ` Jeff Law
  0 siblings, 0 replies; 5+ messages in thread
From: Jeff Law @ 2014-05-09 19:36 UTC (permalink / raw)
  To: Kyrill Tkachov, GCC Patches

On 04/17/14 10:43, Kyrill Tkachov wrote:
> Hi all,
>
> While looking at the build logs I noticed a warning while building
> tree-ssa-loop-ivcanon.c about a potential use of an uninitialised variable.
> This patchlet fixes that warning by initialising it to 0.
>
> Tested arm-none-eabi.
>
> Ok for trunk?
>
> 2014-04-17  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
>
>      * tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables):
>      Initialise n_unroll to 0.
So did you do a thorough analysis to verify that it was a false positive 
or that it was a valid warning?

For the former, it would be helpful if you filed a BZ.  We track these 
false positives for -Wuninitialized and do try to correct them.  If the 
latter then is using 0 for the initializer the safe thing to do?

Jeff

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] Fix uninitialised variable warning in tree-ssa-loop-ivcanon.c
@ 2014-04-17 16:45 Kyrill Tkachov
  2014-05-09 19:36 ` Jeff Law
  0 siblings, 1 reply; 5+ messages in thread
From: Kyrill Tkachov @ 2014-04-17 16:45 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 411 bytes --]

Hi all,

While looking at the build logs I noticed a warning while building tree-ssa-loop-ivcanon.c about a potential use of an uninitialised variable.
This patchlet fixes that warning by initialising it to 0.

Tested arm-none-eabi.

Ok for trunk?

2014-04-17  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	* tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables):
	Initialise n_unroll to 0.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: tree-ssa-loop-ivcanon.patch --]
[-- Type: text/x-patch; name=tree-ssa-loop-ivcanon.patch, Size: 519 bytes --]

diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c
index cdf1559..7a83b12 100644
--- a/gcc/tree-ssa-loop-ivcanon.c
+++ b/gcc/tree-ssa-loop-ivcanon.c
@@ -656,7 +656,7 @@ try_unroll_loop_completely (struct loop *loop,
 			    HOST_WIDE_INT maxiter,
 			    location_t locus)
 {
-  unsigned HOST_WIDE_INT n_unroll, ninsns, max_unroll, unr_insns;
+  unsigned HOST_WIDE_INT n_unroll = 0, ninsns, max_unroll, unr_insns;
   gimple cond;
   struct loop_size size;
   bool n_unroll_found = false;

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-05-09 19:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-17 17:08 [PATCH] Fix uninitialised variable warning in tree-ssa-loop-ivcanon.c Daniel Marjamäki
2014-04-22  8:10 ` Kyrill Tkachov
2014-04-22  8:42   ` Richard Biener
  -- strict thread matches above, loose matches on Subject: below --
2014-04-17 16:45 Kyrill Tkachov
2014-05-09 19:36 ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).