summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2011-09-13 20:03:34 (GMT)
committerdgp <dgp@users.sourceforge.net>2011-09-13 20:03:34 (GMT)
commitc6e44af1862f2818ef3586bf70986d7f75c5ae77 (patch)
tree8ce021e431f45aeac3d1d0860a7f30d7d819445b /generic
parentb859929a2a06d844e2dbd36a7a897ef892285820 (diff)
parent6b9fd91cb423efbab3b7cab0c94f43b7da713024 (diff)
downloadtcl-c6e44af1862f2818ef3586bf70986d7f75c5ae77.zip
tcl-c6e44af1862f2818ef3586bf70986d7f75c5ae77.tar.gz
tcl-c6e44af1862f2818ef3586bf70986d7f75c5ae77.tar.bz2
3390638 Workaround broken solaris studio cc optimizer.
Thanks to Wolfgang S. Kechel.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclUtil.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index eaa7eae..5119456 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -3165,7 +3165,8 @@ TclFormatInt(buffer, n)
* negating it produces the same value.
*/
- if (n == -n) {
+ intVal = -n; /* [Bug 3390638] Workaround for*/
+ if (n == -n || intVal == n) { /* broken compiler optimizers. */
return sprintf(buffer, "%ld", n);
}