[Bug tree-optimization/126735] New: [16/17 Regression] -Wmaybe-uninitialized false positive under -fsanitize=thread -O1

"gnu.ojxq8 at dralias dot com via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126735

            Bug ID: 126735
           Summary: [16/17 Regression]  -Wmaybe-uninitialized false
                    positive under -fsanitize=thread -O1
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gnu.ojxq8 at dralias dot com
  Target Milestone: ---

flags to repro:

-O1 -fsanitize=thread -Wall -Wextra -Wmaybe-uninitialized -std=c++11

code to repro:

#include <map>
std::map<int, int> CreateMap();
void ReproduceMapCopyWarning() {
    auto map_result = CreateMap();
    for (const auto& map_entry : {map_result, map_result});
}


https://godbolt.org/z/bo7Yd1Ecq
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.