[Bug middle-end/115581] could remove copy of struct if original otherwise not used

2024-06-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115581 --- Comment #4 from Andrew Pinski --- (In reply to Barnabás Pőcze from comment #3) > Isn't your testcase a bit different? I guess my question is, why does gcc > feel the need to make a local copy of a by-value argument when calling a > function

[Bug middle-end/115581] could remove copy of struct if original otherwise not used

2024-06-21 Thread pobrn at protonmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115581 --- Comment #3 from Barnabás Pőcze --- Isn't your testcase a bit different? I guess my question is, why does gcc feel the need to make a local copy of a by-value argument when calling a function with a reference to it, but seemingly only in a fu

[Bug middle-end/115581] could remove copy of struct if original otherwise not used

2024-06-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115581 --- Comment #2 from Andrew Pinski --- Note it looks like clang does some front-end optimization for converting the lambda into a function pointer because my example in comment #1 has the copy still there for clang/LLVM.

[Bug middle-end/115581] could remove copy of struct if original otherwise not used

2024-06-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115581 Andrew Pinski changed: What|Removed |Added Severity|normal |enhancement

[Bug middle-end/115581] could remove copy of struct if original otherwise not used

2024-06-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115581 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |NEW Component|other