This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author dim
Recipients benjamin.peterson, dim, eric.smith, mark.dickinson, serhiy.storchaka, vstinner
Date 2017-04-24.22:45:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1493073932.92.0.473278952994.issue30124@psf.upfronthosting.co.za>
In-reply-to
Content
There is a "#pragma clang optimize", but it only has the options "on" or "off", for specific source locations.  I guess that would defeat the purpose a little bit. :(

As an experiment, and to show what would be needed (at minimum), I have attempted to make Python/dtoa.c completely aliasing-safe here:

https://github.com/DimitryAndric/cpython/commit/29c3f6f5cd771fce5630f127b9e7054593e3160c

This allowed to remove the -fno-strict-aliasing flag again, and it succeeded all tests, even with clang 5.0.0.

It basically replaces the direct union member accesses with getters and setters, which do the right thing for clang.  Note that even though those getters and setters use memcpy(), this is actually completely optimized away in the resulting assembly.  (Old compilers might not fare that well, though.)

In any case, while these are mostly mechanical changes, it is still a lot of code churn, and it should really be reviewed by the original maintainer of dtoa, David M. Gay.  I have no idea whether he is still active, though...
History
Date User Action Args
2017-04-24 22:45:32dimsetrecipients: + dim, mark.dickinson, vstinner, eric.smith, benjamin.peterson, serhiy.storchaka
2017-04-24 22:45:32dimsetmessageid: <1493073932.92.0.473278952994.issue30124@psf.upfronthosting.co.za>
2017-04-24 22:45:32dimlinkissue30124 messages
2017-04-24 22:45:32dimcreate