4 ms·
When I tested this before (some years ago), adding "restrict" to the C pointers resulted in the same behavior, so the aliasing default seem to be the key issue.
by nitwit005 2y ago
When I tested this before (some years ago), adding "restrict" to the C pointers resulted in the same behavior, so the aliasing default seem to be the key issue.
- AlotOfReading 2y agoYour compiler very likely assumes strict aliasing at whatever optimization level you're already using, so restrict usually won't do much. GCC does at O2, keil (and clang?) at O1.
- kazinator 2y agoBut restrict says "I promise that these things don't overlap, on penalty of my program going to hell". Is that what's going on in Fortran?