My understanding of it is: Please correct me if I'm wrong [i haven't
verified this with tree dumps]
-fno-strict-aliasing tells each pointer that it can alias with everything
else (puts it in alias set 0)
__attribute__((malloc)) overwrites this so that the compiler knows that
this particular pointer that has been returned (puts it into an own
alias set again and overwrites the -fno-strict-aliasing default)
Another way to overwrite it would be restrict, but nobody uses that
currently. May make sense to add it to compile compiler version checked
macros too, so that it can be safely used.
Then it would be actually possible to write functions that get optimized
this way. I'm aware that the aliasing stuff mostly helps with array walks
and loops, which are not that common in the kernel, but it could be still
useful.
-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/