[Bug c++/104348] New: Incorrect sorting in constexpr constructor
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104348 Bug ID: 104348 Summary: Incorrect sorting in constexpr constructor Product: gcc Version: 10.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: asorenji at gmail dot com Target Milestone: --- I have simple test code, that just sorting array of string_view wrapped in another class. This array contain list of "1","2","3","4","5","6","7","8" values and remains unchanged if code executed in runtime. Well, it's already sorted from beginning. But if constexpr used and code executed it compile time, I get 17256348 instead of 12345678. For very strangle reason, bug appear in constexpr variable constructor, but disappear in constinit variable constructor. g++ --version - g++ (Debian 10.2.1-6) 10.2.1 20210110 Compile options - g++ -std=c++20 -Wall -Wextra main.cpp -o test Code: #include #include #include class Test { public: //for some reason, bug don't appear if std::string_view not wrapped in another class class Value { public: constexpr Value(const char*str):data(str){} constexpr bool operator<(const Value)const{return data
[Bug libstdc++/98505] New: Capture groups under quantifier must capture only last match
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98505 Bug ID: 98505 Summary: Capture groups under quantifier must capture only last match Product: gcc Version: 8.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: asorenji at gmail dot com Target Milestone: --- I'm not sure if this bug or not, but in regex ((a)|(b))* with ECMAScript flavor and text "ab" I get second and third group matched in one time. If I run same test in https://regex101.com/ with ECMAScript flavor, only third group matched https://regex101.com/r/66otHS/1/ (yes, for other flavors both group matched). Let's assume that both group should matched. Second group for first char, third group for second char. Then why can't I compile (a|b\\1)* expression with same logic for "aba" text? If this expression incorrect, then this tricks don't planned. std::regex regex("((a)|(b))*",std::regex_constants::ECMAScript); std::match_results results; if(std::regex_search("ab",results,regex)) //1 1 as result std::cout<
[Bug c++/91407] Wnon-virtual-dtor should't fire for classes with operator delete=delete
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91407 --- Comment #4 from Aso Renji --- (In reply to Jonathan Wakely from comment #3) > But it's not enabled by -Wall7 > > Maybe QtCreator should be fixed instead. Hmm, compile output in QtCreator: g++ -c -pipe -g -Wall -W -fPIC -DQT_QML_DEBUG -I../test -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o main.o ../test/main.cpp I try ran this in console and don't get any warning. But Qt itself show "warning: 'Test' has virtual functions but non-virtual destructor". So, you right, this is problem in QtCreator.
[Bug c++/91407] Wnon-virtual-dtor should't fire for classes with operator delete=delete
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91407 --- Comment #2 from Aso Renji --- (In reply to Jonathan Wakely from comment #1) > Is there a reason you need to use -Wnon-virtual-dtor ? QtCreator with -Wall as default compile option. Yes, I can set custom compile options, or use #pragma GCC diagnostic ignored "-Wnon-virtual-dtor". But it's not very convenient.
[Bug c++/91407] New: Wnon-virtual-dtor should't fire for classes with operator delete=delete
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91407 Bug ID: 91407 Summary: Wnon-virtual-dtor should't fire for classes with operator delete=delete Product: gcc Version: 8.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: asorenji at gmail dot com Target Milestone: --- Okay, attempt of delete polymorphic class without virtual destructor, lead to UB. But, I want trivially destructible class with virtual functions. So, I just mark operator delete as delete. No delete expression - no problem. But gcc still show me a warning. gcc (Debian 8.3.0-6) 8.3.0 Command line: gcc main.cpp -Wnon-virtual-dtor Source: class Test { public: virtual void foo(){} void operator delete(void*)=delete; }; int main() { return 0; } Yes, yes, although "delete pointer" don't work, "::delete pointer" still worked. But it's just a shoot in the foot.
[Bug tree-optimization/86050] Inline break tail-call optimization
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86050 --- Comment #6 from Aso Renji --- (In reply to Konstantin Kharlamov from comment #5) > Just tested with 8.3.0 version on the other PC, same there, i.e. stack space > does not increase when built with -O2. So this was fixed at least since > 8.3.0. Tested _after_ remove __attribute__((noinline)) from code? g++ --version g++ (Debian 8.3.0-6) 8.3.0 bug still present for me. Change "static __attribute__((noinline)) void" to "static void" and: Consumed 8384063 bytes Consumed 8384127 bytes Consumed 8384191 bytes Consumed 8384255 bytes Consumed 8384319 bytes Consumed 8384383 bytes Consumed 8384447 bytes Ошибка сегментирования
[Bug middle-end/86050] New: Inline break tail-call optimization
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86050 Bug ID: 86050 Summary: Inline break tail-call optimization Product: gcc Version: 6.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: asorenji at gmail dot com Target Milestone: --- I have deep tail-recursion and try check how many bytes it consumed. Algorithm for this very simple - pointer to variable in main function minus pointer to variable in current recursive call. If function for this check have noinline attribute, tail-call optimization doing well and my recursion consume very little amount of memory. But if I remove noinline attribute, optimization don't work and I get stack overflow. OS - Debian Stretch. g++ --version - g++ (Debian 6.3.0-18+deb9u1) 6.3.0 20170516 Command line - g++ -O2 main.cpp -o main Code: #include using namespace std; struct Parent { virtual void tailCall(const char*,long )const{} }; struct Child:Parent { //remove noinline and you get stack overflow static __attribute__((noinline)) void stackConsume(const char*stack){ char value; std::cout<<"Consumed "<tailCall(stack,++deep); } Parent*next=this; }; int main() { Parent*parent=new Child; char stack; parent->tailCall(,0); return 0; }
[Bug c++/41874] Incorrect "dereferencing type-punned pointer will break strict-aliasing rules" warning
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41874 --- Comment #15 from Aso Renji --- (In reply to Jonathan Wakely from comment #14) > What do you mean by "same problem"? The original testcase does not produce a > warning with GCC 6.3.0 No, this warning still appear if (and only if) you use -O2 or -O3 optimization key (as it be in startpost with "g++ -O3 -Wstrict-aliasing test.cc -o /dev/null" line). If I don't use any optimization - yes, this warning don't appeared.
[Bug c++/41874] Incorrect "dereferencing type-punned pointer will break strict-aliasing rules" warning
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41874 Aso Renji changed: What|Removed |Added CC||asorenji at gmail dot com --- Comment #13 from Aso Renji --- Still have same problem in g++ 6.3.0. So, please reopen this bug.