[Bug libstdc++/105857] codecvt::do_length causes unexpected buffer overflow

2024-11-27 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105857 --- Comment #16 from andysem at mail dot ru --- Thanks for the fix. And for the explanation. Yes, backport would be nice.

[Bug libstdc++/105857] codecvt::do_length causes unexpected buffer overflow

2024-11-19 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105857 --- Comment #7 from andysem at mail dot ru --- Reproduces for me: $ g++ -g2 -O0 -o codecvt_length_bug codecvt_length_bug.cpp $ ./codecvt_length_bug *** buffer overflow detected ***: terminated Aborted (core dumped) $ g++ -v Using built-in specs

[Bug libstdc++/105857] codecvt::do_length causes unexpected buffer overflow

2024-11-19 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105857 --- Comment #8 from andysem at mail dot ru --- I think, sanitizers won't detect it unless you build libstdc++ with them enabled. I would expect valgrind to detect it though. I think, Ubuntu builds libstdc++ with _FORTIFY_SOURCE enabled, which is

[Bug libstdc++/105857] codecvt::do_length causes unexpected buffer overflow

2024-11-19 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105857 --- Comment #3 from andysem at mail dot ru --- I'm not sure about the meaning of the wrong-code keyword, but just to clear, I do not consider the code sample in the bug report to be wrong (i.e. incorrect usage of the standard library). If it is w

[Bug c++/116697] Bogus -Wuninitialized warning when no access to uninitialized data is done

2024-09-13 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116697 --- Comment #2 from andysem at mail dot ru --- When we say "uninitialized", we refer to a specific data access, i.e. when a certain operation uses an object whose value is unspecified as input. With some stretch, you could consider a mere load of

[Bug c++/116697] New: Bogus -Wuninitialized warning when no access to uninitialized data is done

2024-09-12 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116697 Bug ID: 116697 Summary: Bogus -Wuninitialized warning when no access to uninitialized data is done Product: gcc Version: 14.2.0 Status: UNCONFIRMED Severity: n

[Bug libstdc++/113099] locale without RTTI uses dynamic_cast before gcc 13.2 or has ODR violation since gcc 13.2

2023-12-26 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113099 --- Comment #13 from andysem at mail dot ru --- (In reply to Jonathan Wakely from comment #12) > (In reply to andysem from comment #11) > > > I'm not sure what you mean by "the compiler is free to generate code that > > > takes it into account."

[Bug libstdc++/113099] locale without RTTI uses dynamic_cast before gcc 13.2 or has ODR violation since gcc 13.2

2023-12-24 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113099 --- Comment #11 from andysem at mail dot ru --- > I'm not sure what you mean by "the compiler is free to generate code that > takes it into account." Takes what into account? What problem does that > freedom cause? I mean the compiler could mo

[Bug libstdc++/113099] locale without RTTI uses dynamic_cast before gcc 13.2 or has ODR violation since gcc 13.2

2023-12-23 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113099 --- Comment #4 from andysem at mail dot ru --- > It's mostly OK to mix code with -frtti and -fno-rtti, but sometimes it bites > you. Note that in this case, it is the standard library that is built with -frtti and the rest of the code is built

[Bug libstdc++/113099] locale without RTTI uses dynamic_cast before gcc 13.2 or has ODR violation since gcc 13.2

2023-12-23 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113099 --- Comment #3 from andysem at mail dot ru --- I think, a failing dynamic_cast would not be useful as this would make std::use_facet unusable with -fno-rtti. Re. ODR violation in the latest code, while it is true that the dynamic/static_cast is

[Bug libstdc++/113099] New: locale without RTTI uses dynamic_cast before gcc 13.2 or has ODR violation since gcc 13.2

2023-12-20 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113099 Bug ID: 113099 Summary: locale without RTTI uses dynamic_cast before gcc 13.2 or has ODR violation since gcc 13.2 Product: gcc Version: 11.4.0 Status: UNCONFIRMED

[Bug target/110096] Would be nice if __builtin_ia32_pause had a portable equivalent as it's applicable to ARM

2023-06-02 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110096 andysem at mail dot ru changed: What|Removed |Added CC||andysem at mail dot ru --- Comm

[Bug c++/109761] Nested class destructor's noexcept specification incorrectly considered as too loose compared to the outer class

2023-05-06 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109761 --- Comment #2 from andysem at mail dot ru --- I don't see how completeness of outer is related to nested's destructor. Or put it another way, how nested's destructor noexcept specification has anything to do with outer, whether it is completed o

[Bug c++/109761] New: Nested class destructor's noexcept specification incorrectly considered as too loose compared to the outer class

2023-05-06 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109761 Bug ID: 109761 Summary: Nested class destructor's noexcept specification incorrectly considered as too loose compared to the outer class Product: gcc Version: 11

[Bug target/98612] _mm_comieq_sd has wrong semantics

2023-03-24 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98612 andysem at mail dot ru changed: What|Removed |Added CC||andysem at mail dot ru --- Comme

[Bug target/108401] gcc defeats vector constant generation with intrinsics

2023-01-16 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108401 --- Comment #7 from andysem at mail dot ru --- To be clear, I'm not asking the compiler to recognize the particular pattern of alternating 0x00 and 0xFF bytes. Because hardcoding this particular pattern won't improve generated code in other cases

[Bug target/108401] gcc defeats vector constant generation with intrinsics

2023-01-16 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108401 --- Comment #6 from andysem at mail dot ru --- (In reply to Andrew Pinski from comment #1) > >and gcc 12 generates a worse code: > > it is not worse really; depending on the how fast moving between the > register sets is. I meant "worse" compar

[Bug target/108401] New: gcc defeats vector constant generation with intrinsics

2023-01-13 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108401 Bug ID: 108401 Summary: gcc defeats vector constant generation with intrinsics Product: gcc Version: 11.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Co

[Bug libstdc++/98978] Consider packing _M_Engaged in the tail padding of T in optional<>

2022-09-18 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98978 --- Comment #6 from andysem at mail dot ru --- (In reply to Jonathan Wakely from comment #5) > (In reply to andysem from comment #3) > > Is there no way to improve standard components implementation? I'd imagine > > you could provide the new imple

[Bug libstdc++/106808] std::string_view range concept requirement causes compile error with Boost.Filesystem

2022-09-02 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106808 --- Comment #10 from andysem at mail dot ru --- (In reply to andysem from comment #8) > (In reply to Jonathan Wakely from comment #7) > > > > Do you want ODR violations? Because that's how you get ODR violations. > > I understand this, but my p

[Bug libstdc++/106808] std::string_view range concept requirement causes compile error with Boost.Filesystem

2022-09-02 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106808 --- Comment #8 from andysem at mail dot ru --- (In reply to Jonathan Wakely from comment #7) > (In reply to andysem from comment #6) > > So do you think this is a problem in Boost.Filesystem? > > I don't know yet, I can't reproduce it with the B

[Bug libstdc++/106808] std::string_view range concept requirement causes compile error with Boost.Filesystem

2022-09-01 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106808 --- Comment #6 from andysem at mail dot ru --- So do you think this is a problem in Boost.Filesystem? I would say this is a regression in string_view as the code is valid in pre-C++23, and I would expect it to stay valid in C++23 onwards. Should

[Bug libstdc++/106808] std::string_view range concept requirement causes compile error with Boost.Filesystem

2022-09-01 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106808 --- Comment #4 from andysem at mail dot ru --- It fails the same way with 12.2 and trunk on godbolt: https://gcc.godbolt.org/z/rT6TWhhvP

[Bug libstdc++/106808] std::string_view range concept requirement causes compile error with Boost.Filesystem

2022-09-01 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106808 --- Comment #3 from andysem at mail dot ru --- I don't have the environment to build gcc locally, so I can't readily test trunk. But I have been told the same issue reproduces with gcc-12 20220319-1ubuntu1 from Ubuntu 22.04: https://github.com/b

[Bug libstdc++/106808] New: std::string_view range concept requirement causes compile error with Boost.Filesystem

2022-09-01 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106808 Bug ID: 106808 Summary: std::string_view range concept requirement causes compile error with Boost.Filesystem Product: gcc Version: 11.2.0 Status: UNCONFIRMED

[Bug libstdc++/105857] codecvt::do_length causes unexpected buffer overflow

2022-06-05 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105857 --- Comment #2 from andysem at mail dot ru --- > outside the [s, s + max_size) range This should be [from, from_to) range. Sorry, posted a little too soon.

[Bug libstdc++/105857] codecvt::do_length causes unexpected buffer overflow

2022-06-05 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105857 --- Comment #1 from andysem at mail dot ru --- Created attachment 53089 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53089&action=edit Test case to reproduce the problem.

[Bug libstdc++/105857] New: codecvt::do_length causes unexpected buffer overflow

2022-06-05 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105857 Bug ID: 105857 Summary: codecvt::do_length causes unexpected buffer overflow Product: gcc Version: 11.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Comp

[Bug c++/88165] error: default member initializer for 'A::B::m' required before the end of its enclosing class

2022-04-22 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88165 --- Comment #13 from andysem at mail dot ru --- (In reply to Jonathan Wakely from comment #10) > (In reply to Fedor Chelnokov from comment #7) > > This struct definition: > > ``` > > struct A { > > struct B { > > int i = 0; > >

[Bug c++/102293] [10/11/12 Regression] ICE when compiling Boost.Xpressive (in value_dependent_expression_p, at cp/pt.c:26730)

2021-09-13 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102293 --- Comment #6 from andysem at mail dot ru --- Ok, thanks for confirming.

[Bug c++/102293] [10/11/12 Regression] ICE when compiling Boost.Xpressive (in value_dependent_expression_p, at cp/pt.c:26730)

2021-09-13 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102293 --- Comment #4 from andysem at mail dot ru --- (In reply to Martin Liška from comment #3) > Dup. > > *** This bug has been marked as a duplicate of bug 100161 *** This bug isn't about a warning but about an ICE. Are you positive this is a dupli

[Bug c++/102293] [10 regression] ICE when compiling Boost.Xpressive (in value_dependent_expression_p, at cp/pt.c:26730)

2021-09-12 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102293 --- Comment #2 from andysem at mail dot ru --- The code compiles if -std=c++03 is replaced with e.g. -std=c++11.

[Bug c++/102293] [10 regression] ICE when compiling Boost.Xpressive (in value_dependent_expression_p, at cp/pt.c:26730)

2021-09-12 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102293 --- Comment #1 from andysem at mail dot ru --- I forgot to mention that the same code compiles successfully with gcc 9.4.0. And here is the output from gcc 11.1.0: In file included from ./boost/assert.hpp:58, from ./boost/xpres

[Bug c++/102293] New: [10 regression] ICE when compiling Boost.Xpressive (in value_dependent_expression_p, at cp/pt.c:26730)

2021-09-12 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102293 Bug ID: 102293 Summary: [10 regression] ICE when compiling Boost.Xpressive (in value_dependent_expression_p, at cp/pt.c:26730) Product: gcc Version: 10.3.0 Status: UNCON

[Bug middle-end/100477] Bogus -Wstringop-overflow warning on memset

2021-05-12 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100477 --- Comment #9 from andysem at mail dot ru --- (In reply to Martin Sebor from comment #8) > > Submitting a bug for the LTO problem is only helpful if it comes with a test > case to reproduce it. I have heard about problems suppressing warnings

[Bug middle-end/100477] Bogus -Wstringop-overflow warning on memset

2021-05-10 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100477 --- Comment #7 from andysem at mail dot ru --- (In reply to Martin Sebor from comment #6) > In C/C++ the size of the largest object is PTRDIFF_MAX - 1 bytes. This is > necessary so that the difference between the address of its first byte and >

[Bug middle-end/100477] Bogus -Wstringop-overflow warning on memset

2021-05-10 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100477 --- Comment #5 from andysem at mail dot ru --- (In reply to Martin Sebor from comment #4) > The case of _size being very large and n very small may be handled correctly > by the original code thanks to the check for _capacity but because its valu

[Bug middle-end/100477] Bogus -Wstringop-overflow warning on memset

2021-05-10 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100477 --- Comment #3 from andysem at mail dot ru --- To put it another way, the case of _size being large and n small is valid, and memset (and resize in general) do behave correctly in this case. Which is why the warning is bogus and the suggested ass

[Bug middle-end/100477] Bogus -Wstringop-overflow warning on memset

2021-05-10 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100477 andysem at mail dot ru changed: What|Removed |Added Status|RESOLVED|UNCONFIRMED Resolution|

[Bug middle-end/100477] New: Bogus -Wstringop-overflow warning on memset

2021-05-07 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100477 Bug ID: 100477 Summary: Bogus -Wstringop-overflow warning on memset Product: gcc Version: 10.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: mi

[Bug tree-optimization/99971] GCC generates partially vectorized and scalar code at once

2021-04-23 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99971 --- Comment #10 from andysem at mail dot ru --- Thanks. Will this be backported to 10 and 11 branches?

[Bug tree-optimization/99971] GCC generates partially vectorized and scalar code at once

2021-04-15 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99971 --- Comment #6 from andysem at mail dot ru --- Hmm, it looks like the original code has changed enough so that the problem no longer reproduces, with or without __restrict__. I don't have the older version of the code, so I can't tell what changed

[Bug tree-optimization/99971] GCC generates partially vectorized and scalar code at once

2021-04-15 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99971 --- Comment #3 from andysem at mail dot ru --- I tried adding __restrict__ to the equivalents of x, y1 and y2 in the original larger code base and it didn't help. The compiler (gcc 10.2) would still generate the same half-vectorized code.

[Bug tree-optimization/99971] GCC generates partially vectorized and scalar code at once

2021-04-08 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99971 --- Comment #1 from andysem at mail dot ru --- For reference, an ideal version of this code should look something like this: test(A&, A const&, A const&): movdqu (%rsi), %xmm0 movdqu (%rdi), %xmm1 movdqu (%rdx), %xmm2

[Bug tree-optimization/99971] New: GCC generates partially vectorized and scalar code at once

2021-04-08 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99971 Bug ID: 99971 Summary: GCC generates partially vectorized and scalar code at once Product: gcc Version: 10.2.0 Status: UNCONFIRMED Severity: normal Pr

[Bug target/99563] [10 Regression] Code miscompilation caused by _mm256_zeroupper()

2021-03-20 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99563 --- Comment #8 from andysem at mail dot ru --- Thanks again.

[Bug target/99563] [10 Regression] Code miscompilation caused by _mm256_zeroupper()

2021-03-16 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99563 --- Comment #5 from andysem at mail dot ru --- Thanks. Will there be a fix in branch 10?

[Bug target/99563] New: Code miscompilation caused by _mm256_zeroupper()

2021-03-12 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99563 Bug ID: 99563 Summary: Code miscompilation caused by _mm256_zeroupper() Product: gcc Version: 10.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component:

[Bug libstdc++/98978] Consider packing _M_Engaged in the tail padding of T in optional<>

2021-02-05 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98978 --- Comment #3 from andysem at mail dot ru --- (In reply to Jonathan Wakely from comment #1) > This would be an ABI break, and so not going to happen. Is there no way to improve standard components implementation? I'd imagine you could provide th

[Bug libstdc++/98978] New: Consider packing _M_Engaged in the tail padding of T in optional<>

2021-02-05 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98978 Bug ID: 98978 Summary: Consider packing _M_Engaged in the tail padding of T in optional<> Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal

[Bug target/97891] [x86] Consider using registers on large initializations

2020-11-19 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97891 --- Comment #5 from andysem at mail dot ru --- Using a register is beneficial even for bytes and words if there are multiple of mov instructions. But there has to be a single reg0 for all movs. I'm not very knowlegeable about gcc internals, but w

[Bug target/97891] [x86] Consider using registers on large initializations

2020-11-18 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97891 --- Comment #1 from andysem at mail dot ru --- As a side note, the "xorl %edx, %edx" in the original code should have been moved outside the loop, as it was in the code with __asm__ block.

[Bug target/97891] New: [x86] Consider using registers on large initializations

2020-11-18 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97891 Bug ID: 97891 Summary: [x86] Consider using registers on large initializations Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priorit

[Bug libstdc++/59325] Provide a way to disable deprecated warnings

2020-10-20 Thread andysem at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59325 --- Comment #8 from andysem at mail dot ru --- (In reply to Jonathan Wakely from comment #6) > (In reply to andysem from comment #2) > > (In reply to Jonathan Wakely from comment #1) > > > You can use a #pragma to disable -Wdeprecated locally > >