[Bug target/118276] memset 88 uses rep stosq while 80 uses SSE

2025-01-06 Thread benfrantzdale at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118276 --- Comment #12 from Ben FrantzDale --- Thanks for clarifying. To be 100% clear, you are saying that with no c'tor, or `= default;`, `S{}` will zero just the non-padding bytes, but adding `S() noexcept {}` drops that requirement? Yes, the middl

[Bug target/118276] memset 88 uses rep stosq while 80 uses SSE

2025-01-03 Thread benfrantzdale at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118276 --- Comment #10 from Ben FrantzDale --- I see the same codegen with `alignas(long) T a[n] = {};`: https://godbolt.org/z/z93KEnoao

[Bug target/118276] memset 88 uses rep stosq while 80 uses SSE

2025-01-02 Thread benfrantzdale at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118276 --- Comment #8 from Ben FrantzDale --- Interesting. It looks like the behavior depends on the data type... If I make 11 `long`s it's different from `11 * sizeof(long)` `char`s: https://godbolt.org/z/nKPcYv4MG

[Bug target/118276] Adding empty c'tor to struct of C-array and integer improves codegen

2025-01-02 Thread benfrantzdale at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118276 --- Comment #6 from Ben FrantzDale --- I think I understand. You are saying that gcc wants to (or must?) zero-out the entire struct in the trivial case, which includes `S() = default;` but with `S() noexcept {}` it winds up on a code path where

[Bug target/118276] Adding empty c'tor to struct of C-array and integer improves codegen

2025-01-02 Thread benfrantzdale at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118276 --- Comment #2 from Ben FrantzDale --- @Andrew Pinski, the quick-bench link shows the `stosq` version running slower. Regardless, the code-gen shouldn't be different, should it? (Is there any semantic difference I'm missing?)

[Bug c++/118276] New: Adding empty c'tor to struct of std::array and integer improves codegen

2025-01-02 Thread benfrantzdale at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118276 Bug ID: 118276 Summary: Adding empty c'tor to struct of std::array and integer improves codegen Product: gcc Version: 14.2.0 Status: UNCONFIRMED Severity: norm