[Bug libstdc++/86516] Spurious warning __builtin_memset at O3 when protected by a conditional involving empty()

2018-07-23 Thread paulg at chiark dot greenend.org.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86516 --- Comment #2 from Paul Gotch --- I can reproduce this at will with GCC 7.3 it does not reproduce with GCC 8 // Compile with g++ -c -Wextra -Wall -Werror -O3 test.cpp #include class Foo { public: Foo() {} virtual ~Foo() {

[Bug libstdc++/86516] New: Spurious warning __builtin_memset at O3 when protected by a conditional involving empty()

2018-07-13 Thread paulg at chiark dot greenend.org.uk
Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: paulg at chiark dot greenend.org.uk Target Milestone: --- This is spurious diagnostic regression in GCC 7 and beyond and is related to two previous bugs

[Bug tree-optimization/80641] missed optimization with with std::vector resize in loop

2018-01-31 Thread paulg at chiark dot greenend.org.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80641 --- Comment #10 from Paul Gotch --- I'm afraid the changes made to libstdc++ have only solved part of the regression if you say something like std::vector v; if(c.size() > 0) c.resize(c.size() - 1); then you no longer get a warning in 7.3

[Bug ipa/82698] New: Spurious warning __builtin_memset at O3

2017-10-24 Thread paulg at chiark dot greenend.org.uk
Assignee: unassigned at gcc dot gnu.org Reporter: paulg at chiark dot greenend.org.uk CC: marxin at gcc dot gnu.org Target Milestone: --- With the following code fragment #include void foo(std::vector & bar) { bar.resize(bar.size() - 1); } compiled wit