[Bug tree-optimization/60165] "may be used uninitialized" warning with -O3 but not with -O2

2016-09-03 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60165 --- Comment #16 from Manuel López-Ibáñez --- (In reply to Vincent Lefèvre from comment #15) > Well, detecting uninitialized variables is equivalent to generating better > code. See the following functions. If you want to be able to remove the i =

[Bug tree-optimization/60165] "may be used uninitialized" warning with -O3 but not with -O2

2018-09-13 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60165 Manuel López-Ibáñez changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug tree-optimization/60165] "may be used uninitialized" warning with -O3 but not with -O2

2018-09-14 Thread vincent-gcc at vinc17 dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60165 --- Comment #18 from Vincent Lefèvre --- OK, but then, this means that the first sentence of the -Wmaybe-uninitialized documentation is incorrect. That's probably the "there exists" that is problematic, because of the possible difference of what

[Bug tree-optimization/60165] "may be used uninitialized" warning with -O3 but not with -O2

2018-09-15 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60165 --- Comment #19 from Manuel López-Ibáñez --- (In reply to Vincent Lefèvre from comment #18) > OK, but then, this means that the first sentence of the > -Wmaybe-uninitialized documentation is incorrect. That's probably the "there > exists" that is

[Bug tree-optimization/60165] "may be used uninitialized" warning with -O3 but not with -O2

2018-09-15 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60165 --- Comment #20 from Marc Glisse --- (In reply to Vincent Lefèvre from comment #18) > OK, but then, this means that the first sentence of the > -Wmaybe-uninitialized documentation is incorrect. That's probably the "there > exists" that is problem

[Bug tree-optimization/60165] "may be used uninitialized" warning with -O3 but not with -O2

2014-02-13 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60165 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #1 f

[Bug tree-optimization/60165] "may be used uninitialized" warning with -O3 but not with -O2

2014-02-13 Thread vincent-gcc at vinc17 dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60165 --- Comment #2 from Vincent Lefèvre --- Well, the code paths in question do not necessarily exist (you could say the same thing with -O2, where the function is not inlined: there may be some code paths for which fn1() doesn't initialize c). Actua

[Bug tree-optimization/60165] "may be used uninitialized" warning with -O3 but not with -O2

2014-02-13 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60165 Jakub Jelinek changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug tree-optimization/60165] "may be used uninitialized" warning with -O3 but not with -O2

2014-02-13 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60165 --- Comment #4 from Richard Biener --- (In reply to Jakub Jelinek from comment #3) > (In reply to Vincent Lefèvre from comment #2) > > Well, the code paths in question do not necessarily exist (you could say the > > same thing with -O2, where the

[Bug tree-optimization/60165] "may be used uninitialized" warning with -O3 but not with -O2

2014-02-13 Thread vincent-gcc at vinc17 dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60165 --- Comment #5 from Vincent Lefèvre --- (In reply to Jakub Jelinek from comment #3) > The code path exists in the code, It exists *only* if fn2() can return 0. But the fact is that in the reality, this can never happen (with the original non-redu

[Bug tree-optimization/60165] "may be used uninitialized" warning with -O3 but not with -O2

2014-02-13 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60165 --- Comment #6 from Jakub Jelinek --- How can the compiler know that fn2 never returns 0, without inlining (not in this case), some attribute (not provided, gcc right now has returns_nonnull attribute but that is only for pointers) or some interpr

[Bug tree-optimization/60165] "may be used uninitialized" warning with -O3 but not with -O2

2014-02-13 Thread vincent-gcc at vinc17 dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60165 --- Comment #7 from Vincent Lefèvre --- (In reply to Jakub Jelinek from comment #6) > How can the compiler know that fn2 never returns 0, without inlining (not in > this case), some attribute (not provided, gcc right now has returns_nonnull > attr

[Bug tree-optimization/60165] "may be used uninitialized" warning with -O3 but not with -O2

2014-02-13 Thread vincent-gcc at vinc17 dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60165 Vincent Lefèvre changed: What|Removed |Added Status|RESOLVED|UNCONFIRMED Resolution|INVALID

[Bug tree-optimization/60165] "may be used uninitialized" warning with -O3 but not with -O2

2014-02-13 Thread glisse at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60165 --- Comment #9 from Marc Glisse --- (In reply to Vincent Lefèvre from comment #8) > The -Wmaybe-uninitialized rule given in the gcc man page is (for GCC 4.8): > > -Wmaybe-uninitialized > For an automatic variable, if there exists a path fro

[Bug tree-optimization/60165] "may be used uninitialized" warning with -O3 but not with -O2

2014-02-13 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60165 --- Comment #10 from Manuel López-Ibáñez --- (In reply to Vincent Lefèvre from comment #8) > Concerning the "if it cannot prove the uninitialized paths are not executed > at run time" part, GCC should be able to prove more things with -O3 than > w

[Bug tree-optimization/60165] "may be used uninitialized" warning with -O3 but not with -O2

2014-02-13 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60165 Manuel López-Ibáñez changed: What|Removed |Added CC||manu at gcc dot gnu.org --- Comment

[Bug tree-optimization/60165] "may be used uninitialized" warning with -O3 but not with -O2

2014-02-13 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60165 --- Comment #12 from Jakub Jelinek --- Only in your reading of the documentation. You clearly don't know what you are asking for, even the very common case of pthread_t th; if (pthread_create (&th, NULL, tf, NULL)) goto fail; pthread_join (th,

[Bug tree-optimization/60165] "may be used uninitialized" warning with -O3 but not with -O2

2014-02-13 Thread glisse at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60165 --- Comment #13 from Marc Glisse --- (In reply to Manuel López-Ibáñez from comment #10) > Now, I agree that ideally, GCC should warn for your last testcase. But I > guess in that case inlining either doesn't happen or it happens too late, so > GCC

[Bug tree-optimization/60165] "may be used uninitialized" warning with -O3 but not with -O2

2014-02-13 Thread vincent-gcc at vinc17 dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60165 --- Comment #14 from Vincent Lefèvre --- (In reply to Marc Glisse from comment #9) > The definition of a function changes with inlining ;-) It shouldn't: what happens at run time isn't changed by inlining. > f(&i) is considered as an initializat

[Bug tree-optimization/60165] "may be used uninitialized" warning with -O3 but not with -O2

2014-02-13 Thread vincent-gcc at vinc17 dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60165 --- Comment #15 from Vincent Lefèvre --- (In reply to Manuel López-Ibáñez from comment #10) > Now, I agree that ideally, GCC should warn for your last testcase. But I > guess in that case inlining either doesn't happen or it happens too late, so >