[Bug libstdc++/89417] helgrind detects a lock order violation inside std::scoped_lock

2020-07-12 Thread federico.kircheis at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89417 Federico Kircheis changed: What|Removed |Added Version|8.2.0 |10.1.0 --- Comment #1 from Federico

[Bug libstdc++/89417] helgrind detects a lock order violation inside std::scoped_lock

2020-07-14 Thread federico.kircheis at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89417 --- Comment #3 from Federico Kircheis --- Thank you for the analysis, explanation and references, I did not think about testing std::lock directly. I'm still unsure if that means that it is a bug in valgrind, unfortunately I do not know other 3

[Bug libstdc++/89417] helgrind detects a lock order violation inside std::scoped_lock

2020-07-15 Thread federico.kircheis at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89417 --- Comment #5 from Federico Kircheis --- (In reply to Jonathan Wakely from comment #4) > (In reply to Federico Kircheis from comment #3) > > My guess, without having looked at the implementation of std::lock, is that > > the algorithm uses try_l

[Bug libstdc++/89417] helgrind detects a lock order violation inside std::scoped_lock

2020-07-15 Thread federico.kircheis at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89417 --- Comment #6 from Federico Kircheis --- For what is worth, I imagined the implementation for parameters of different type and more or less than two to be similar to template auto sorted_indexes(Args&... args) { const void* addresses[

[Bug c++/96507] New: Feature request: improve "-Waddress" (or equivalent) for function references inside structs

2020-08-06 Thread federico.kircheis at gmail dot com
NCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: federico.kircheis at gmail dot com Target Milestone: --- This is a feature request. I'm compiling the code with "-Wall -Wextra -peda

[Bug c++/96945] New: optimizations regression when defaulting copy constructor

2020-09-05 Thread federico.kircheis at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: federico.kircheis at gmail dot com Target Milestone: --- While toying with a piece of code, I've noticed that the code did not get optimized as expected. All snippets where compiled wit

[Bug c++/96945] optimizations regression when defaulting copy constructor

2020-09-05 Thread federico.kircheis at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96945 --- Comment #1 from Federico Kircheis --- I've made a copy-paste error (I cant change the submitted bug), after B) it should come C): Adding and defaulting the constructors, except the move constructor produces the same code as A): https://go

[Bug libgcc/89417] New: helgrind detects a lock order violation inside std::scoped_lock

2019-02-20 Thread federico.kircheis at gmail dot com
Priority: P3 Component: libgcc Assignee: unassigned at gcc dot gnu.org Reporter: federico.kircheis at gmail dot com Target Milestone: --- Created attachment 45776 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45776&action=edit helgrind log output Hel

[Bug c++/89718] New: _Pragma GCC diagnostic ignored inside macro

2019-03-14 Thread federico.kircheis at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: federico.kircheis at gmail dot com Target Milestone: --- Given following piece of code #define DIAGNOSTIC_HELPER0(x) #x #define DIAGNOSTIC_HELPER1(kind, y) DIAGNOSTIC_HELPER0(GCC diagnostic kind #y) #define DIAGNOSTIC(kind

[Bug c++/89718] _Pragma GCC diagnostic ignored inside macro

2019-03-14 Thread federico.kircheis at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89718 --- Comment #1 from Federico Kircheis --- I've missed a line while copy-pasting the test program, there was a missing ')' at the end: #define DIAGNOSTIC_HELPER0(x) #x #define DIAGNOSTIC_HELPER1(kind, y) DIAGNOSTIC_HELPER0(GCC diagnostic kin

[Bug c++/89718] _Pragma GCC diagnostic ignored inside macro

2019-03-14 Thread federico.kircheis at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89718 --- Comment #4 from Federico Kircheis --- (In reply to Jakub Jelinek from comment #2) > The tokens on which you expect the warning come from an area of the code > that is not in between the pragmas, so the gcc behavior looks good to me > here. M

[Bug c++/90029] New: optimizing local exceptions, or are they an observable side effect

2019-04-09 Thread federico.kircheis at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: federico.kircheis at gmail dot com Target Milestone: --- Hello, this is partly a question, and partly a feature request Consider following functions int bar_ex_noexcept(int i

[Bug c++/90029] optimizing local exceptions, or are they an observable side effect

2019-04-09 Thread federico.kircheis at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90029 --- Comment #2 from Federico Kircheis --- Thank you for your answer, I need to learn better how to search for related bugs. The bugs you linked do surely answer my question, but they do not cover exactly the same requests. 1) optimize dead call

[Bug c++/90880] New: compile error instead of SFINAE with non-public member variables

2019-06-13 Thread federico.kircheis at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: federico.kircheis at gmail dot com Target Milestone: --- Hello, I searched for bugs related to SFINAE, and I do not think that this one has already reported: #include #include

[Bug c++/90881] New: -Wunused-value false positive with

2019-06-13 Thread federico.kircheis at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: federico.kircheis at gmail dot com Target Milestone: --- Hello, consider #include template struct status : std::false_type{}; template struct status : std::true_type {}; struct s1{int member;}; struct s2{int _member;}; int

[Bug c++/90880] compile error instead of SFINAE with non-public member variables

2019-06-13 Thread federico.kircheis at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90880 --- Comment #1 from Federico Kircheis --- After researching a little bit more, I've convinced myself that `status::value` should be false, as `decltype` has no special rules for accessing private data, thus clang is correct. If someone could con

[Bug c++/90880] compile error instead of SFINAE with non-public member variables

2019-06-13 Thread federico.kircheis at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90880 --- Comment #3 from Federico Kircheis --- (In reply to Jonathan Wakely from comment #2) > (In reply to Federico Kircheis from comment #1) > > After researching a little bit more, I've convinced myself that > > `status::value` should be false, as

[Bug c++/90881] -Wunused-value false positive in SFINAE context

2019-06-14 Thread federico.kircheis at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90881 --- Comment #4 from Federico Kircheis --- (In reply to Jonathan Wakely from comment #1) > Confirmed. We shouldn't give that warning in unevaluated contexts (decltype, > sizeof, etc.) because unevaluated operands have no effects at all, with or >

[Bug c++/90881] -Wunused-value false positive in SFINAE context

2019-06-14 Thread federico.kircheis at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90881 --- Comment #6 from Federico Kircheis --- > With my patch, we wouldn't warn on this second testcase. But clang++ > doesn't warn, either. Yes, I just wanted to point out that giving warning in unevaluated contexts has some benefits too. I believ

[Bug c++/90881] -Wunused-value false positive in SFINAE context

2019-06-22 Thread federico.kircheis at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90881 --- Comment #9 from Federico Kircheis --- Hi, did you consider my last comment (Comment 6)? I find it unfortunate that gcc will not warn anymore about unused variables in some circumstances. Maybe my example was not a good one, but I guess tha

[Bug c++/91000] New: noexcept in constexpr context with std=c++11 and std=c++14

2019-06-25 Thread federico.kircheis at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: federico.kircheis at gmail dot com Target Milestone: --- I've used following snippet of code for testing if inside a constepxr context: template constexpr void test_constexpr_hel

[Bug c++/91000] noexcept in constexpr context with std=c++11 and std=c++14

2019-06-26 Thread federico.kircheis at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91000 --- Comment #2 from Federico Kircheis --- (In reply to Jonathan Wakely from comment #1) > This would be more appropriate on the gcc-help mailing list, as you're > asking a question not reporting a bug. > > The behaviour is as intended, for all -

[Bug c++/91000] noexcept in constexpr context with std=c++11 and std=c++14

2019-06-26 Thread federico.kircheis at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91000 --- Comment #4 from Federico Kircheis --- > As I explained in PR 87603 comment 6, and as the patch > https://gcc.gnu.org/ml/gcc-patches/2019-04/msg00466.html says, the old > behaviour triggers unwanted instantiations and so causes valid code to n

[Bug c++/87760] New: Unable to delete overloads of std::memset on arm

2018-10-25 Thread federico.kircheis at gmail dot com
: c++ Assignee: unassigned at gcc dot gnu.org Reporter: federico.kircheis at gmail dot com Target Milestone: --- Hello, I know this is technically speaking undefined behavior (not allowed to change things inside namespace std), and thus not a bug but more a feature request

[Bug c++/79791] New: -Werror=write-strings ignored with -Wpedantic

2017-03-01 Thread federico.kircheis at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: federico.kircheis at gmail dot com Target Milestone: --- Given following program: int main(){ char* str = "hello world!"; (void)str; } When compiling with "-Werror=write-strings", the expected output

[Bug c++/82736] New: -Wl not wrapping all functions call

2017-10-26 Thread federico.kircheis at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: federico.kircheis at gmail dot com Target Milestone: --- AFAIK, std::chrono::system_clock::now(); uses clock_gettime internally. For various reasons (unit testing), I would like to "mock" time calls, so I tried to use the

[Bug c++/82736] -Wl not wrapping all functions call

2017-10-26 Thread federico.kircheis at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82736 --- Comment #4 from Federico Kircheis --- Thank you very much for your feedback. With "-static" or "-static-libstdc++" i got the expected (at least for me) result. I guess that I'll need to register to https://sourceware.org/bugzilla/ to ask if

[Bug c/66918] Disable "inline function declared but never defined" warning

2020-11-04 Thread federico.kircheis at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66918 Federico Kircheis changed: What|Removed |Added CC||federico.kircheis at gmail dot com

[Bug tree-optimization/18487] Warnings for pure and const functions that are not actually pure or const

2021-01-15 Thread federico.kircheis at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=18487 Federico Kircheis changed: What|Removed |Added CC||federico.kircheis at gmail dot com

[Bug middle-end/102209] NRVO for function parameters

2022-03-08 Thread federico.kircheis at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102209 --- Comment #2 from Federico Kircheis --- Isn't the compiler allowed to do copy/move elision even if observable since before c++17?

[Bug tree-optimization/18487] Warnings for pure and const functions that are not actually pure or const

2021-09-04 Thread federico.kircheis at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=18487 --- Comment #26 from Federico Kircheis --- As multiple people commented this Ticket, I do not know to who the least message is sent, but I would like to give again my opinion on it, as I would really like to use those attributes in non-toy projec

[Bug tree-optimization/18487] Warnings for pure and const functions that are not actually pure or const

2021-09-04 Thread federico.kircheis at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=18487 --- Comment #27 from Federico Kircheis --- Edit: sorry, my last comment about what GCC thinks is wrong. GCC seems to follow the gnu::pure/gnu::const directive to the letter, it does not ignore it when it sees the implementation of the function,

[Bug tree-optimization/18487] Warnings for pure and const functions that are not actually pure or const

2021-09-04 Thread federico.kircheis at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=18487 --- Comment #28 from Federico Kircheis --- >Edit: sorry, my last comment about what GCC thinks is wrong. Unless it is going to inline the function call, in that case the attributes are as-if ignored (at least the case I've tested with GCC 11.2).

[Bug tree-optimization/18487] Warnings for pure and const functions that are not actually pure or const

2021-09-04 Thread federico.kircheis at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=18487 --- Comment #30 from Federico Kircheis --- It seems to me we are not going to agree as we tend to repeat ourselves, lets see if we go around and around in circles or if it is more like a spiral ;) Your view is more about the compiler, how it i

[Bug c++/102209] New: NRVO for function parameters

2021-09-05 Thread federico.kircheis at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: federico.kircheis at gmail dot com Target Milestone: --- I believe this is a missed optimization opportunity. Given following class and functions: struct s{ s(); s(const s&); s(s&&); void doit(); }; s bar0()

[Bug c++/102223] New: no warning whel calling member function on dangling reference

2021-09-06 Thread federico.kircheis at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: federico.kircheis at gmail dot com Target Milestone: --- Consider this code-snippet struct s{ s() noexcept; ~s(); int value() const noexcept; }; s foo() noexcept; int

[Bug c++/102223] no warning whel calling member function on dangling reference

2021-09-06 Thread federico.kircheis at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102223 --- Comment #1 from Federico Kircheis --- Sorry, I copied the wrong snippet, it should have been #include struct s{ s() noexcept; ~s(); int value() const noexcept; }; s foo() noexcept; int bar(){ const auto& v = std::move

[Bug c++/102223] no warning when calling member function on dangling reference

2021-09-08 Thread federico.kircheis at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102223 --- Comment #6 from Federico Kircheis --- > are you expecting this to go under an existing warning flag, or a new one? Ideally -Wall, but there might already be some flags related to dangling pointers and references. > Your compiler explorer l

[Bug c++/102482] New: Winit-list-lifetime false positive for temporaries with std::initializer_list

2021-09-25 Thread federico.kircheis at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: federico.kircheis at gmail dot com Target Milestone: --- Following program #include struct span { span(std::initializer_list il) noexcept : begin(il.begin

[Bug c++/102482] Winit-list-lifetime false positive for temporaries with std::initializer_list

2021-09-28 Thread federico.kircheis at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102482 --- Comment #4 from Federico Kircheis --- Note that following equivalent snippet #include struct span { span(std::initializer_list il) noexcept : begin(nullptr), size(il.size()) { begin = il.begin();} const int* begin; std::s

[Bug c++/102223] no warning when calling member function on dangling reference

2021-09-28 Thread federico.kircheis at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102223 --- Comment #8 from Federico Kircheis --- > There is though, on line 10. You are correct, I wonder how I could not see it.

[Bug c++/102846] New: Misleading suggestion to include cassert

2021-10-19 Thread federico.kircheis at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: federico.kircheis at gmail dot com Target Milestone: --- Consider following snippet (https://godbolt.org/z/9e19bP1Gh) #include template auto verify(F f, C1* p1){ f(p1); return p1; } void bar(void* ptr

[Bug c++/106213] New: -Werror=deprecated-copy-dtor does not trigger warning and error

2022-07-06 Thread federico.kircheis at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: federico.kircheis at gmail dot com Target Milestone: --- Consider struct s{ int* i; s(); ~s(){ delete i;} }; void bar(){ s instance; s instance2 = instance

[Bug c++/101557] New: the value of '' is not usable in a constant expression

2021-07-21 Thread federico.kircheis at gmail dot com via Gcc-bugs
ty: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: federico.kircheis at gmail dot com Target Milestone: --- Consider following snippet struct node { const char* d; const node& left; const node& right; }; co

[Bug c++/101557] the value of '' is not usable in a constant expression

2021-07-21 Thread federico.kircheis at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101557 --- Comment #2 from Federico Kircheis --- clang does not reject it: https://godbolt.org/z/8Mq1e3o3j

[Bug c++/101557] the value of '' is not usable in a constant expression

2021-07-21 Thread federico.kircheis at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101557 --- Comment #4 from Federico Kircheis --- Indeed. I just checked the latest versions. I wonder if there is a common cause that makes this recursive data structure harder to evaluate at compile time.