| Issue |
61559
|
| Summary |
clang misses pass by value optimization opportunity if using C++ default member initialization
|
| Labels |
|
| Assignees |
|
| Reporter |
Haiderahandali
|
according to the output of clang trunk on godbolt https://godbolt.org/z/c1a8ooWfe
I feel that it misses some optimization chances by removing the copy entirely instead of creating the variable on the stack and then copy it, because the caller, never really modifies the **big_struct** object.
switching to C-style initialization (or turning off the default member initialization of the struct) seems to fix it.
as shown here:
https://godbolt.org/z/E7x1x7To8
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs