For the following code: $ more jan5c.cc struct S { long a; long b; long c; long d; long a2; long b2; long c2; long d2; }; void f1( const S s); void f2( S s); gcc has not a lot to say: $ /home/dcb/gcc/results/bin/gcc -c -O2 -Wall -Wextra -pedantic jan5c.cc $ cppcheck does a slightly better job: $ /home/dcb/cppcheck/trunk.git/cppcheck --enable=all jan5c.cc jan5c.cc:14:18: performance: Function parameter 's' should be passed by const reference. [passedByValue] void f1( const S s); ^ Also, clang-13 doesn't say anything. Judgement call, but "large" might mean four words or more. Example code derived from code in the Linux kernel, so even kernel programmers do this kind of thing in practice.
Actually I think the warning is incorrect as there are aliasing implications if passed by reference instead of by value.
Also consider void f1 (const S s, S * __restrict q); where obeying the warning would create a false alias when called as f1 (x, &x); whether passing by value or reference is more efficient also depends on the context - if the aggregate doesn't live in memory at (all) callers and register passing conventions are in effect then passing by reference requires materializing the argument on the stack.
related to bug 59552 and/or bug 70047 perhaps?