[swift-dev] deprecating -Ounchecked

Chris Lattner clattner at nondot.org
Thu Nov 2 22:50:55 CDT 2017


> On Nov 2, 2017, at 9:52 AM, Erik Eckstein via swift-dev <swift-dev at swift.org> wrote:
> 
> Hi,
> 
> I’d like to propose to deprecate the -Ounchecked swift optimization mode.
> 
> The -Ounchecked mode actually contradicts one of the main goals of swift: to be a safe language.
> In the past we didn’t see lot of significant performance differences compared to -O (there were some improvements but also some regressions).
> Also, we want to reduce the effort of maintaining too many different optimization modes, especially because we recently added -Osize.
> 
> Deprecating would mean that we map -Ounchecked to -O.
> 
> If you have any comments or concerns, please let me know

What’s the motivation for this?  What problem does it solve?

Swift isn’t a "strict safety at all costs” language.  It is a pragmatic language which aims to give people tools to solve problems.  One of the nice things about -Ounchecked is that it provides an easy way to get a data point about the cost of runtime checks.

-Chris



More information about the swift-dev mailing list