summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
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 19332c8..b327b99 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -2160,7 +2160,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. */
sprintf(buffer, "%ld", n);
return strlen(buffer);
}