http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53309
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |burnus at gcc dot gnu.org
Depends on| |57959
Resolution|--- |WORKSFORME
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Let's close this as WONTFIX.
-Warray-temporaries warns if the compiler adds code for temporaries. In case of
actual arguments, there is a run-time check, which only does the
copy-in/copy-out if the variable is noncontiguous.
As Thomas wrote, you can use -fcheck-array-temporaries which prints at runtime
a warning if the copy-in/copy-out actually happened.
If the compiler knows that the actual argument is contiguous, it can avoid the
copy-in altogether. For your example, simply mark the dummy argument "a" of
sub_wrap as CONTIGUOUS (or use an explicit/assumed-size array instead).