[Bug rtl-optimization/115056] [14/15 regression] Miscompilation (also triggering -Wstringop-overflow and -Warray-bounds warning) when -O2 or higher

2024-05-12 Thread weilercdale at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115056 --- Comment #10 from Dale Weiler --- New test case without UB still exhibits the behavior #include #include typedef union { unsigned char as_bytes[64]; unsigned long long as_chunks[64 / sizeof(unsigned long long)]; } Block; in

[Bug rtl-optimization/115056] [14/15 regression] Miscompilation (also triggering -Wstringop-overflow and -Warray-bounds warning) when -O2 or higher

2024-05-12 Thread weilercdale at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115056 --- Comment #8 from Dale Weiler --- Yeah, you can add another `while (j < 64) block.as_bytes[j] = 0;` to the end if you want. I really should've done a better job reducing it so as not to create uninitialized memory. You can also just memset the

[Bug rtl-optimization/115056] [14 regression] Miscompilation (also triggering -Wstringop-overflow and -Warray-bounds warning) when -O2 or higher

2024-05-12 Thread weilercdale at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115056 --- Comment #5 from Dale Weiler --- I should note that there is a byte in-between these two pieces of code I removed for (; j < i; j++) block.as_bytes[j] = argv[0][j]; block.as_bytes[j] = 0x01; // I removed this line while (++j &

[Bug rtl-optimization/115056] [14 regression] Miscompilation (also triggering -Wstringop-overflow and -Warray-bounds warning) when -O2 or higher

2024-05-12 Thread weilercdale at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115056 --- Comment #3 from Dale Weiler --- > You don't have to share, but I find it useful to know where stuff was reduced > from. Was it a public library? If so, what? It is OK to not answer. It's the inner part of the Tiger Hash cryptographic hash

[Bug rtl-optimization/115056] New: Miscompilation triggering -Wstringop-overflow and -Warray-bounds warning when -O2 or higher

2024-05-12 Thread weilercdale at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115056 Bug ID: 115056 Summary: Miscompilation triggering -Wstringop-overflow and -Warray-bounds warning when -O2 or higher Product: gcc Version: 14.1.1 Status: UNCONFIRMED

[Bug c++/101566] gcc miscompiles lambda used as tuple-like object applied to function for call

2021-07-21 Thread weilercdale at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101566 --- Comment #7 from Dale Weiler --- Yeah the code example is invalid, there is a reference to a temporary, decltype(auto) on *ptr produces reference type, somehow I thought it produced the value type, sorry for the confusion.

[Bug c++/101566] gcc miscompiles lambda used as tuple-like object applied to function for call

2021-07-21 Thread weilercdale at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101566 Dale Weiler changed: What|Removed |Added Resolution|--- |INVALID Status|UNCONFIRMED

[Bug c++/101566] gcc miscompiles lambda used as tuple-like object applied to function for call

2021-07-21 Thread weilercdale at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101566 --- Comment #5 from Dale Weiler --- (In reply to Dale Weiler from comment #4) > (In reply to Andrew Pinski from comment #3) > > (In reply to Dale Weiler from comment #2) > > > Ah, passing `T&` here instead of T does appear to avoid the issue, t

[Bug c++/101566] gcc miscompiles lambda used as tuple-like object applied to function for call

2021-07-21 Thread weilercdale at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101566 --- Comment #4 from Dale Weiler --- (In reply to Andrew Pinski from comment #3) > (In reply to Dale Weiler from comment #2) > > Ah, passing `T&` here instead of T does appear to avoid the issue, the > > question now becomes why does -fsanitize=

[Bug c++/101566] gcc miscompiles lambda used as tuple-like object applied to function for call

2021-07-21 Thread weilercdale at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101566 --- Comment #2 from Dale Weiler --- (In reply to Andrew Pinski from comment #1) > f.0_1 = f_8(D); > tuple = t; > _11 = &tuple.__ts#2; > tuple ={v} {CLOBBER}; > > > template > constexpr decltype(auto) get(T tuple) { return *tuple(Get{})

[Bug c++/101566] New: gcc miscompiles lambda used as tuple-like object applied to function for call

2021-07-21 Thread weilercdale at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101566 Bug ID: 101566 Summary: gcc miscompiles lambda used as tuple-like object applied to function for call Product: gcc Version: unknown Status: UNCONFIRMED Severit