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 petdance
Recipients ezio.melotti, petdance, vstinner
Date 2020-02-08.21:45:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1581198329.98.0.186422149655.issue39588@roundup.psfhosted.org>
In-reply-to
Content
Four functions in Objects/unicodectype.c copy values out of lookup tables with a for loop

        int i;
        for (i = 0; i < n; i++)
            res[i] = _PyUnicode_ExtendedCase[index + i];

instead of a memcpy

        memcpy(res, &_PyUnicode_ExtendedCase[index], n * sizeof(Py_UCS4));

My Apple clang version 11.0.0 on my Mac optimizes away the for loop and generates equivalent code to the memcpy.

gcc 4.8.5 on my Linux box (the newest GCC I have) does not optimize away the loop.

The four functions are:
_PyUnicode_ToLowerFull
_PyUnicode_ToTitleFull
_PyUnicode_ToUpperFull
_PyUnicode_ToFoldedFull
History
Date User Action Args
2020-02-08 21:45:30petdancesetrecipients: + petdance, vstinner, ezio.melotti
2020-02-08 21:45:29petdancesetmessageid: <1581198329.98.0.186422149655.issue39588@roundup.psfhosted.org>
2020-02-08 21:45:29petdancelinkissue39588 messages
2020-02-08 21:45:29petdancecreate