Menu

#3768 tcl segfaults when using intel compiler

obsolete: 8.4.15
closed-fixed
9
2007-08-24
2007-08-24
Anonymous
No

When compiling tcl with the intel compiler (icc 10.0 20070426 - x386, linux) and optimisation enabled, the resulting executable segfaults. The issue is in the file generic/tclCompile.c, function TclFixupForwardJump.

What the compiler apparently does not understand/screws up in optimisation is the loop

for (numBytes = envPtr->codeNext-jumpPc-2, p = jumpPc+2+numBytes-1;
numBytes > 0; numBytes--, p--) {
p[3] = p[0];
}

Changing p to 'volatile' solves the problem - e.g. changing the line

unsigned char* jumpPc,p;

to

unsigned char* jumpPc;
volatile unsigned char* p;

It would be great, if the above would not be dismissed as a 'compiler issue'. I think the best solution would be if someone who is familiar with the code could convert the loop into a call to memmove (assuming that call is available on most platforms)?

Discussion

  • Donal K. Fellows

    • priority: 5 --> 9
     
  • miguel sofer

    miguel sofer - 2007-08-24
    • status: open --> closed-fixed
     
  • Don Porter

    Don Porter - 2007-08-24

    Logged In: YES
    user_id=80530
    Originator: NO

    Now, that a workaround is in Tcl's source code,
    I hope someone will report this "compiler issue"
    to the maintainers of the misbehaving compiler.

     
MongoDB Logo MongoDB