[PATCH] D27163: Introduce -f[no-]strict-return flag that controls code generation for C++'s undefined behaviour return optimisation
Mehdi AMINI via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 28 12:04:31 PST 2016
mehdi_amini added a comment.
In https://reviews.llvm.org/D27163#606744, @arphaman wrote:
> In https://reviews.llvm.org/D27163#606695, @mehdi_amini wrote:
>
> > What is the justification for a platform specific default change here?
>
>
> The flag itself is platform agnostic, however, the default value is different on Darwin (-fno-strict-return). The reason for this difference is because of how I interpreted the internal discussion for this issue: it seems that some of our internal builds had problems with this flag, so to me it seemed that people would've wanted this specific difference upstream.
I was not involved in the internal discussion, and the pre-existing internal arguments should be repeated here when needed to drive the patch.
I find dubious that the compiler wouldn't have specific handling for undefined behavior on a specific platform, without a strong argument that justify it (like a platform with a different hardware memory model making it more sensitive, etc.). In the current case, it seems like a "vendor specific choice" of being more conservative rather than something attached to the platform itself, so I'm not sure it makes sense to hard-code this upstream.
Do we have past records of doing this?
Repository:
rL LLVM
https://reviews.llvm.org/D27163
More information about the cfe-commits
mailing list