[Bug libstdc++/105810] __glibcxx_assert can be improved greatly.

2024-07-19 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105810 Bug 105810 depends on bug 105809, which changed state. Bug 105809 Summary: [11 Regression] __PRETTY_FUNCTION__ in constexpr in function vs NSDMI https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105809 What|Removed

[Bug libstdc++/105810] __glibcxx_assert can be improved greatly.

2024-02-03 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105810 --- Comment #11 from Jonathan Wakely --- (In reply to Jonathan Wakely from comment #2) > Specifically, the suggested implementation is: > > template > [[noreturn,__gnu__::__cold__,__gnu__::__noinline__]] > inline void __my_glibcxx_constexpr_as

[Bug libstdc++/105810] __glibcxx_assert can be improved greatly.

2022-06-08 Thread unlvsur at live dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105810 --- Comment #10 from cqwrteur --- (In reply to Jonathan Wakely from comment #7) > Right, but that function doesn't even exist today, so there's nothing to > merge today. This change adds new symbols (one for every assertion in the > library) whi

[Bug libstdc++/105810] __glibcxx_assert can be improved greatly.

2022-06-08 Thread unlvsur at live dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105810 --- Comment #9 from cqwrteur --- if I use std::span, the compiler would have to emit assertions in every function I use them, while the 2nd case would only do that once for the operation [] case for example. It reduces the code size of the funct

[Bug libstdc++/105810] __glibcxx_assert can be improved greatly.

2022-06-08 Thread unlvsur at live dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105810 --- Comment #8 from cqwrteur --- (In reply to Jonathan Wakely from comment #7) > Right, but that function doesn't even exist today, so there's nothing to > merge today. This change adds new symbols (one for every assertion in the > library) whic

[Bug libstdc++/105810] __glibcxx_assert can be improved greatly.

2022-06-08 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105810 --- Comment #7 from Jonathan Wakely --- Right, but that function doesn't even exist today, so there's nothing to merge today. This change adds new symbols (one for every assertion in the library) which must be assembled and then merged by the li

[Bug libstdc++/105810] __glibcxx_assert can be improved greatly.

2022-06-08 Thread unlvsur at live dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105810 --- Comment #6 from cqwrteur --- (In reply to Jonathan Wakely from comment #5) > (In reply to cqwrteur from comment #4) > > btw since the function is inline linkaged, the entire program would only > > contain one copy of __my_glibcxx_constexpr_a

[Bug libstdc++/105810] __glibcxx_assert can be improved greatly.

2022-06-08 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105810 --- Comment #5 from Jonathan Wakely --- (In reply to cqwrteur from comment #4) > btw since the function is inline linkaged, the entire program would only > contain one copy of __my_glibcxx_constexpr_assert. For example for > std::span::operator[

[Bug libstdc++/105810] __glibcxx_assert can be improved greatly.

2022-06-07 Thread unlvsur at live dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105810 --- Comment #4 from cqwrteur --- (In reply to cqwrteur from comment #3) > (In reply to Jonathan Wakely from comment #2) > > Specifically, the suggested implementation is: > > > > template > > [[noreturn,__gnu__::__cold__,__gnu__::__noinline__]]

[Bug libstdc++/105810] __glibcxx_assert can be improved greatly.

2022-06-07 Thread unlvsur at live dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105810 --- Comment #3 from cqwrteur --- (In reply to Jonathan Wakely from comment #2) > Specifically, the suggested implementation is: > > template > [[noreturn,__gnu__::__cold__,__gnu__::__noinline__]] > inline void __my_glibcxx_constexpr_assert() n

[Bug libstdc++/105810] __glibcxx_assert can be improved greatly.

2022-06-07 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105810 --- Comment #2 from Jonathan Wakely --- Specifically, the suggested implementation is: template [[noreturn,__gnu__::__cold__,__gnu__::__noinline__]] inline void __my_glibcxx_constexpr_assert() noexcept { constexpr __glibcxxassertiontype __

[Bug libstdc++/105810] __glibcxx_assert can be improved greatly.

2022-06-01 Thread unlvsur at live dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105810 --- Comment #1 from cqwrteur --- You can see this generates extremely good assembly even under -Os https://godbolt.org/z/oaerzYeo6