[Bug c++/58950] Missing "statement has no effect"
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58950 --- Comment #26 from Andrew Pinski --- (In reply to Andrew Pinski from comment #25) > (In reply to Marc Glisse from comment #6) > > For: > > > > void f(){ > > int i = 2; > > (i+i); > > } > > This case is fixed on the trunk: > > : In function 'void f1()': > :9:5: warning: statement has no effect [-Wunused-value] > 9 | (i+i); > | ~~^~~ I think it was fixed via r12-1804-g65870e75616ee4359d1c13b99 .
[Bug c++/58950] Missing "statement has no effect"
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58950 Andrew Pinski changed: What|Removed |Added Keywords||needs-bisection --- Comment #25 from Andrew Pinski --- (In reply to Marc Glisse from comment #6) > For: > > void f(){ > int i = 2; > (i+i); > } This case is fixed on the trunk: : In function 'void f1()': :9:5: warning: statement has no effect [-Wunused-value] 9 | (i+i); | ~~^~~
[Bug c++/58950] Missing "statement has no effect"
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58950 --- Comment #24 from nightstrike --- Ah.. I missed Comment #13, the PR is still open because of a slightly different test. In any case, if it worked in 4.8, it should be a regression.
[Bug c++/58950] Missing "statement has no effect"
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58950 nightstrike changed: What|Removed |Added CC||nightstrike at gmail dot com --- Comment #23 from nightstrike --- Given that Comment #1 clearly shows g++ 4.8 working, I think this should qualify as a regression. Moreover, g++ 6.2 works correctly, so this was fixed at some point between 4.9 and 6.2: $ cat > a.cc void f() { int i __attribute__((vector_size(2*sizeof(int={2,3}; __builtin_shuffle(i,i); } $ g++ -c a.cc -Wunused-value a.cc: In function 'void f()': a.cc:3:3: warning: value computed is not used [-Wunused-value] __builtin_shuffle(i,i); ^
[Bug c++/58950] Missing statement has no effect
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58950 Andrew Pinski pinskia at gcc dot gnu.org changed: What|Removed |Added Target Milestone|4.9.4 |---
[Bug c++/58950] Missing statement has no effect
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58950 Jakub Jelinek jakub at gcc dot gnu.org changed: What|Removed |Added Target Milestone|4.9.3 |4.9.4
[Bug c++/58950] Missing statement has no effect
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58950 --- Comment #22 from Jakub Jelinek jakub at gcc dot gnu.org --- GCC 4.9.3 has been released.
[Bug c++/58950] Missing statement has no effect
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58950 Marek Polacek mpolacek at gcc dot gnu.org changed: What|Removed |Added CC||mpolacek at gcc dot gnu.org --- Comment #21 from Marek Polacek mpolacek at gcc dot gnu.org --- Should this be P1?
[Bug c++/58950] Missing statement has no effect
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58950 Jakub Jelinek jakub at gcc dot gnu.org changed: What|Removed |Added Target Milestone|4.9.2 |4.9.3 --- Comment #20 from Jakub Jelinek jakub at gcc dot gnu.org --- GCC 4.9.2 has been released.
[Bug c++/58950] Missing statement has no effect
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58950 Jakub Jelinek jakub at gcc dot gnu.org changed: What|Removed |Added Target Milestone|4.9.1 |4.9.2 --- Comment #19 from Jakub Jelinek jakub at gcc dot gnu.org --- GCC 4.9.1 has been released.
[Bug c++/58950] Missing statement has no effect
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58950 Jakub Jelinek jakub at gcc dot gnu.org changed: What|Removed |Added Target Milestone|4.9.0 |4.9.1 --- Comment #18 from Jakub Jelinek jakub at gcc dot gnu.org --- GCC 4.9.0 has been released
[Bug c++/58950] Missing statement has no effect
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58950 Marc Glisse glisse at gcc dot gnu.org changed: What|Removed |Added CC||paolo.carlini at oracle dot com --- Comment #14 from Marc Glisse glisse at gcc dot gnu.org --- (In reply to Marc Glisse from comment #7) The current patch breaks g++.dg/ext/vla13.C (PR 54583), but nothing else covered by the testsuite, so it is tempting to see if there are other ways to fix PR 54583. Paolo, do you have an opinion on this PR?
[Bug c++/58950] Missing statement has no effect
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58950 --- Comment #15 from Paolo Carlini paolo.carlini at oracle dot com --- I don't think you simply want a better fix for 54583, because for the testcase in #Comment 13 the new conditional setting TREE_NO_WARNING isn't used. Otherwise, I think it would be easy to tighten it via array_of_runtime_bound_p.
[Bug c++/58950] Missing statement has no effect
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58950 --- Comment #16 from Marc Glisse glisse at gcc dot gnu.org --- (In reply to Paolo Carlini from comment #15) I don't think you simply want a better fix for 54583, because for the testcase in #Comment 13 the new conditional setting TREE_NO_WARNING isn't used. Otherwise, I think it would be easy to tighten it via array_of_runtime_bound_p. The issue isn't with setting the bit but reading it. If you look at the patch, I remove a test for TREE_NO_WARNING (expr). This breaks 54583 because the TREE_NO_WARNING bit is then ignored.
[Bug c++/58950] Missing statement has no effect
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58950 --- Comment #17 from Paolo Carlini paolo.carlini at oracle dot com --- Yes, I know that. What I'm saying is that other code may want to see that TREE_NO_WARNING honored, the issue doesn't have much to do with 54583 per se. In my personal opinion removing a TREE_NO_WARNING check is in general a pretty risky thing to do, because unfortunately we have only that generic bit and we use it in many different circumstances.
[Bug c++/58950] Missing statement has no effect
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58950 Marc Glisse glisse at gcc dot gnu.org changed: What|Removed |Added Summary|[4.9 Regression] Missing|Missing statement has no |statement has no effect |effect --- Comment #13 from Marc Glisse glisse at gcc dot gnu.org --- Testcase for the remaining part of the PR: void f(){ int i=2; (i+i); // should warn with -Wall }