public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/20968] spurious "may be used uninitialized" warning (conditional PHIs)
       [not found] <bug-20968-4@http.gcc.gnu.org/bugzilla/>
@ 2013-11-19  7:07 ` law at redhat dot com
  0 siblings, 0 replies; 4+ messages in thread
From: law at redhat dot com @ 2013-11-19  7:07 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20968

Jeffrey A. Law <law at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |law at redhat dot com
         Resolution|---                         |FIXED

--- Comment #9 from Jeffrey A. Law <law at redhat dot com> ---
Fixed, not sure how long ago.  4.8.2 is clean.  I did double check that it's
clean because we actually do all the right things in the optimizers to both
eliminate the unwanted ADDRESSOF which then exposes "i" as a local scalar. 
Then the optimizers thread the paths properly and as a result there's no
uninitializes uses left (in fact, there are no uses of "i" left as the only one
was determined to be a constant.


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

* [Bug middle-end/20968] spurious "may be used uninitialized" warning (conditional PHIs)
       [not found] <bug-20968-10415@http.gcc.gnu.org/bugzilla/>
  2009-02-07 16:27 ` manu at gcc dot gnu dot org
  2009-12-30 16:59 ` manu at gcc dot gnu dot org
@ 2010-04-21  0:28 ` davidxl at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: davidxl at gcc dot gnu dot org @ 2010-04-21  0:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from davidxl at gcc dot gnu dot org  2010-04-21 00:27 -------
(In reply to comment #2)
> Note this is not fully a regression but really a progression.
> What is happening now is only partial optimizations is happen before the warning to happen.
> 
> >I was unable to reduce the test case further without making the warning
> >disappear.  In particular, removing the increment of v1->count makes the warning
> >disappear.
> This is because we would then jump thread he jump.
> 
> Again this is because we are emitting the warning too soon, I might be able to come up with a testcase 
> which shows that this is not really a regression but a progression in that we have warned in 3.4 and 
> 4.0:
> struct {int count;} *v1;
> int c;
> int k;
> 
> extern void baz(int);
> void foo(void)
> {
>     int i;
>     int r;
>     if (k == 4)
>     {
>         i = 1;
>         r = 1;
>     }
>     else
>         r = 0;
> 
>     if (!r)
>     {
>         if (!c)
>             return;
>         v1->count++;
>     }
>     if (!c)
>     {
>         baz(i);
>     }
> }
> 
> There is no different from the case above and the functions you gave below.
> 
> There has been some talking about moving where we warn about uninitialized variables but I feel that 
> you can get around this in your code.

To reproduce the problem -- -fno-tree-vrp  -fno-tree-dominator-opts
-fno-tree-ccp are needed. This 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20968


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

* [Bug middle-end/20968] spurious "may be used uninitialized" warning (conditional PHIs)
       [not found] <bug-20968-10415@http.gcc.gnu.org/bugzilla/>
  2009-02-07 16:27 ` manu at gcc dot gnu dot org
@ 2009-12-30 16:59 ` manu at gcc dot gnu dot org
  2010-04-21  0:28 ` davidxl at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: manu at gcc dot gnu dot org @ 2009-12-30 16:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from manu at gcc dot gnu dot org  2009-12-30 16:59 -------
*** Bug 42145 has been marked as a duplicate of this bug. ***


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |colin at reactos dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20968


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

* [Bug middle-end/20968] spurious "may be used uninitialized" warning (conditional PHIs)
       [not found] <bug-20968-10415@http.gcc.gnu.org/bugzilla/>
@ 2009-02-07 16:27 ` manu at gcc dot gnu dot org
  2009-12-30 16:59 ` manu at gcc dot gnu dot org
  2010-04-21  0:28 ` davidxl at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: manu at gcc dot gnu dot org @ 2009-02-07 16:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from manu at gcc dot gnu dot org  2009-02-07 16:27 -------
This is just another case that would require conditional PHIs. I am not marking
it as a duplicate of bug 36550, because this case is harder than then typical:

if(q) p=1;
something()
if(q) use(p);

Therefore, it may be possible to fix bug 36550 and still not fix this.


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |36550
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-02-07 16:27:01
               date|                            |
            Summary|Spurious "may be used       |spurious "may be used
                   |uninitialized" warning      |uninitialized" warning
                   |                            |(conditional PHIs)


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20968


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

end of thread, other threads:[~2013-11-19  7:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-20968-4@http.gcc.gnu.org/bugzilla/>
2013-11-19  7:07 ` [Bug middle-end/20968] spurious "may be used uninitialized" warning (conditional PHIs) law at redhat dot com
     [not found] <bug-20968-10415@http.gcc.gnu.org/bugzilla/>
2009-02-07 16:27 ` manu at gcc dot gnu dot org
2009-12-30 16:59 ` manu at gcc dot gnu dot org
2010-04-21  0:28 ` davidxl at gcc dot gnu dot org

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).