[Bug middle-end/32667] block copy with exact overlap is expanded as memcpy

2024-06-18 Thread lopresti at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32667 --- Comment #64 from Patrick J. LoPresti --- The C (and POSIX) standards have had "restrict" on the arguments to memcpy() since C99. So calling it with overlapping arguments is undefined behavior and always has been. This bug should be trivial t

[Bug c++/109642] False Positive -Wdangling-reference with std::span-like classes

2024-01-30 Thread lopresti at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109642 --- Comment #17 from Patrick J. LoPresti --- Are all of the "duplicate" bugs also fixed by this change?

[Bug middle-end/32667] block copy with exact overlap is expanded as memcpy

2023-11-22 Thread lopresti at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32667 --- Comment #29 from Patrick J. LoPresti --- (In reply to Jakub Jelinek from comment #27) > > No, that is not a reasonable fix, because it severely pessimizes common code > for a theoretical only problem. The very existence of (and interest in)

[Bug c++/109671] Spurious dangling reference warning in GCC 13

2023-04-30 Thread lopresti at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109671 --- Comment #3 from Patrick J. LoPresti --- (In reply to Andrew Pinski from comment #1) > There is no way for GCC to know that get_foo_by_name does not store the > argument into what is returned so it warns about this case ... To summarize: GC

[Bug c++/109671] Spurious dangling reference warning in GCC 13

2023-04-28 Thread lopresti at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109671 --- Comment #2 from Patrick J. LoPresti --- Um... OK... So I have to "correct" my code like so: const Foo &bug(bool x) { const std::string s = (x ? "x" : "y"); const Foo &f = get_foo_by_name(s); return f; } But if get_foo_by_name() has

[Bug c++/109671] New: Spurious dangling reference warning in GCC 13

2023-04-28 Thread lopresti at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109671 Bug ID: 109671 Summary: Spurious dangling reference warning in GCC 13 Product: gcc Version: 13.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component:

[Bug middle-end/32667] block copy with exact overlap is expanded as memcpy

2023-01-06 Thread lopresti at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32667 --- Comment #22 from Patrick J. LoPresti --- I disagree that bug 108296 is a duplicate. That bug requires code that, at least arguably, invokes undefined behavior. See e.g. https://stackoverflow.com/q/7292862/ and https://stackoverflow.com/q/6107