A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-September/113731.html below:

[Python-Dev] Heads up: Apple llvm gcc 4.2 miscompiles PEP 393

[Python-Dev] Heads up: Apple llvm gcc 4.2 miscompiles PEP 393martin at v.loewis.de martin at v.loewis.de
Wed Sep 28 13:24:22 CEST 2011
The gcc that Apple ships with the Lion SDK (not sure what Xcode  
version that is)
miscompiles Python now. I've reported this to Apple as bug 10143715;  
not sure whether
there is a public link to this bug report.

In essence, the code

typedef struct {
     long length;
     long hash;
     int state;
     int *wstr;
} PyASCIIObject;

typedef struct {
     PyASCIIObject _base;
     long utf8_length;

     char *utf8;
     long wstr_length;

} PyCompactUnicodeObject;

void *_PyUnicode_compact_data(void *unicode) {
     return ((((PyASCIIObject*)unicode)->state & 0x20) ?
             ((void*)((PyASCIIObject*)(unicode) + 1)) :
             ((void*)((PyCompactUnicodeObject*)(unicode) + 1)));
}

miscompiles (with -O2 -fomit-frame-pointer) to


__PyUnicode_compact_data:
Leh_func_begin1:
         leaq    32(%rdi), %rax
         ret

The compiler version is

gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)

This unconditionally assumes that sizeof(PyASCIIObject) needs to be
added to unicode, independent of whether the state bit is set or not.

I'm not aware of a work-around in the code. My work-around is to use gcc-4.0,
which is still available on my system from an earlier Xcode installation
(in /Developer-3.2.6)

Regards,
Martin


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4