Simon Anders added the comment:

Martin, you are right: is is related to compiler optimization. I have
boiled it down to a call of stringlib_find (defined in
Python-2.5.1/Objects/stringlib/find.h) and this runs fine with 'icc -O2'
but incorrectly for 'icc -O3'. (The test code is attached.)

So, it seems that the lesson is simply once again: Do not use '-O3' with
Intel's C compiler. (At least, for me, it is not the first time that
this caused trouble.)

On the other hand, Python's ./configure script is quite clear in its
preference of GCC, anyway: It more or less ignores with option
'--without-gcc' and uses the content of the CC environment variable only
very occasionally.

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1084>
__________________________________
#define STRINGLIB_CHAR char

#define STRINGLIB_CMP memcmp
#define STRINGLIB_LEN PyString_GET_SIZE
#define STRINGLIB_NEW PyString_FromStringAndSize
#define STRINGLIB_STR PyString_AS_STRING

#define STRINGLIB_EMPTY nullstring

#include "/usr/site/hc-2.6/python/gnu/2.5.1/include/python2.5/Python.h"

#include "../Python-2.5.1/Objects/stringlib/fastsearch.h"
#include "../Python-2.5.1/Objects/stringlib/find.h"

int main ()
{
   STRINGLIB_CHAR* str = "foo2/**bar**/";
   Py_ssize_t str_len = strlen (str);
   STRINGLIB_CHAR* sub = "/**bar**/";
   Py_ssize_t sub_len = strlen (sub);
   Py_ssize_t offset = 0;
   Py_ssize_t res;

   res = stringlib_find(str, str_len, sub, sub_len, offset);

   printf ("%d\n", res);
   return 0;
}
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to