[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
Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: weilercdale at gmail dot com Target Milestone: --- I've isolated what appears to be an unsound __builtin_memset optimization applied b

[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
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: weilercdale at gmail dot com Target Milestone: --- Created attachment 51191 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51191&action=edit minimized te

[Bug rtl-optimization/83367] static global constructors stack memory corruption

2017-12-20 Thread weilercdale at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83367 --- Comment #5 from Dale Weiler --- Except they are referenced via their this pointer (which should alias the static storage in that translation unit). I don't see how this is any different than having a static variable in a translation unit and

[Bug rtl-optimization/83367] static global constructors stack memory corruption

2017-12-11 Thread weilercdale at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83367 --- Comment #3 from Dale Weiler --- (In reply to Richard Biener from comment #2) > Try -fno-lifetime-dse? Tried that, same issue.

[Bug rtl-optimization/83367] New: static global constructors stack memory clobbering

2017-12-11 Thread weilercdale at gmail dot com
Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: weilercdale at gmail dot com Target Milestone: --- Created attachment 42835 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42835&action=edit I've combined three files here because Bugzi