Artifacts Associated With Ticket 3390638
Ticket change [87d0f1be3c] (rid 131763) by wkechel on 2011-08-12 16:09:03:
- assignee initialized to: "dgp"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Tcl fails when build with natice solaris studio cc under sparc solaris 10. Compiler optimzation breaks tclUtil.c:TclFormatInt. Indicator: tests fail. Simple testcase 'format %d 0x80000000' -> -s OOPS?? The following patch solves the issue: in tclUtils.c:TclFormatInt change the code after the comment /* * Check whether "n" is the maximum negative value. This is * -2^(m-1) for an m-bit word, and has no positive equivalent; * negating it produces the same value. */ old: if (n == -n) { return sprintf(buffer, "%ld", n); } NEW: intVal = -n; if (n == -n || intVal == n) { return sprintf(buffer, "%ld", n); } My Configuration (no gcc in path!): ssol10% echo $path /usr2/gnu/bin /usr2/scripts /usr/bin /sbin /usr/sbin /usr/ccs/bin /usr/bin/X11 /usr/bin /usr/openwin/bin /usr/dt/bin ssol10% ../unix/configure --prefix=/usr2/gnu - foundin initialized to: "None"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "wkechel"
- subsystem initialized to: "48. Number Handling"
- title initialized to: "Tcl failes sparc solaris 10 with native cc"
- type initialized to: "Bug"
Ticket change [51c96e69c1] (rid 126187) by wkechel on 2011-08-12 23:09:51:
- title changed to:
Tcl f8.5.9/10 fails sparc solaris 10 with native cc
- title changed to:
Ticket change [806a4153c9] (rid 116861) by wkechel on 2011-08-12 23:14:54:
- title changed to: "Tcl f8.5.10 fails sparc solaris 10 with native cc"
Ticket change [e2f0c9b9db] (rid 87705) by wkechel on 2011-08-12 23:17:28:
- icomment:
This code was not present in 8.5.9, sprintf was used directly. Why has this been modified and broken?
- login: "wkechel"
- mimetype: "text/plain"
- username: "wkechel"
- icomment:
Ticket change [876afe17e7] (rid 131693) by dgp on 2011-09-14 02:29:35:
- icomment:
TclFormatInt() was brought back into Tcl 8.5 just as it is in Tcl 8.4. The attempt to replace it with a sprintf() call was too costly in performance loss when used in Tcl applications that produce large tables of printed numbers. I assume Tcl 8.4 has the same problem on your platform? FWIW, I cannot reproduce the problem on a local Solaris 10 system building Tcl with "Forte Developer 7 C 5.4" Nevertheless, if the patch works around your optimizer woes, we might as well apply it.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [49307455ac] (rid 100017) by dgp on 2011-09-14 03:05:22:
- closedate changed to: "2011-09-13T20:05:22"
- closer changed to: "dgp"
- icomment:
allow_comments - 1 Patch accepted on all release branches.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Accepted"
- status changed to: "Closed"
- username: "dgp"