Artifacts Associated With Ticket 1735583
Ticket change [e7bb4eda0a] (rid 104519) by fridolin on 2007-06-12 09:09:58:
- assignee initialized to: "dgp"
- cmimetype initialized to: "text/plain"
- comment initialized to:
gcc was 4.1.2, x86 processor, an older glibc ==== expr-47.12 isqrt of various sizes of integer FAILED ==== Contents of test case: set faults 0 for {set i 0} {$faults < 10 && $i <= 1024} {incr i} { set root [expr {1 << $i}] set rm1 [expr {$root - 1}] set arg [expr {1 << (2 * $i)}] set tval [expr {isqrt($arg-1)}] if {$tval != $rm1} { append trouble "i = " $i ": isqrt(" $arg "-1) == " $tval " != " $rm1 "\n" incr faults } set tval [expr {isqrt($arg)}] if {$tval != $root} { append trouble "i = " $i ": isqrt(" $arg ") == " $tval " != " $root "\n" incr faults } set tval [expr {isqrt($arg+1)}] if {$tval != $root} { append trouble "i = " $i ": isqrt(" $arg "+1) == " $tval " != " $root "\n" incr faults } } set trouble ---- Result was: i = 28: isqrt(72057594037927936-1) == 279620267 != 268435455 i = 28: isqrt(72057594037927936+1) == 279620267 != 268435456 i = 29: isqrt(288230376151711744-1) == 545818760 != 536870911 i = 29: isqrt(288230376151711744+1) == 545818760 != 536870912 i = 30: isqrt(1152921504606846976-1) == 1079707056 != 1073741823 i = 30: isqrt(1152921504606846976+1) == 1079707056 != 1073741824 i = 31: isqrt(4611686018427387904-1) == 2150992608 != 2147483647 i = 31: isqrt(4611686018427387904+1) == 2150992608 != 2147483648 i = 32: isqrt(18446744073709551616-1) == 4296881274 != 4294967295 i = 41: isqrt(4835703278458516698824704-1) == 2199023259647 != 2199023255551 ---- Result should have been (exact matching): ==== expr-47.12 FAILED - foundin initialized to: "obsolete: 8.5a6"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "fridolin"
- subsystem initialized to: "48. Number Handling"
- title initialized to: "Test expr-47.12 fails on linux"
- type initialized to: "Bug"
Ticket change [056b5febd6] (rid 89061) by dgp on 2007-06-12 21:01:27:
- assignee changed to: "kennykb"
- closedate changed to: "2007-06-12T14:01:27"
- closer changed to: "dgp"
- icomment:
Logged In: YES user_id=80530 Originator: NO Dup of 1609936?
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Duplicate"
- status changed to: "Pending"
- username: "dgp"
Ticket change [ebcab26cb2] (rid 103590) by fridolin on 2007-06-15 19:24:12:
- icomment:
Logged In: YES user_id=13583 Originator: YES Yes, it is an duplicate. Tcl is compiled with gcc-4.1.2. If bn_mp_sqrt.c is compiled with -O0 helps, then the expr test doesn't fail anymore (CVS head branch).
- login: "fridolin"
- mimetype: "text/plain"
- status changed to: "Open"
- username: "fridolin"
- icomment:
Ticket change [22a3d52fe3] (rid 130784) by kennykb on 2007-06-18 09:05:15:
- icomment:
Logged In: YES user_id=99768 Originator: NO Your remark about 'an older glibc' may be a key. Since it appears that it's the 'ldexp' function that's failing -- or at least, that's what happened the earlier time that we saw these exact symptoms - it could be that rather than the compiler's being at fault, it's the library. In any case, trying with a library that (at least) matches the compiler would provide a useful data point. I really, really want to avoid the endless rat race of coding around everyone's bugs in compilers and standard libraries. ldexp is a fundamental floating-point operation; it's in the standard library because it's insanely difficult to do in a portable fashion -- except in cases of over/underflow, it's required to return an exact result. I concede that we do work around bugs in MSVC - but that compiler enjoys something of a privileged status because, well frankly, because a tremendous number of people use it in spite of the fact that Microsoft has an abysmal record of fixing bugs.
- login: "kennykb"
- mimetype: "text/plain"
- username: "kennykb"
- icomment:
Ticket change [4f150c3051] (rid 125764) by fridolin on 2007-06-18 17:52:23:
- closedate changed to: "2007-06-18T10:52:23"
- closer changed to: "fridolin"
- icomment:
Logged In: YES user_id=13583 Originator: YES I guess it's not the glibc but an gcc optimizer bug, since recompiling with -O0 fixes the problem with the same old glibc. (The gcc is build from sources against this old glibc). But anyway, I close this bug, since it it related to gcc (or glibc).
- login: "fridolin"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "fridolin"