Skip to content
Tcl Source Code History Of Ticket 1735583
Login

History Of Ticket 1735583

Artifacts Associated With Ticket 1735583

  1. Ticket change [e7bb4eda0a] (rid 104519) by fridolin on 2007-06-12 09:09:58:

    1. assignee initialized to: "dgp"
    2. cmimetype initialized to: "text/plain"
    3. 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
      
      
    4. foundin initialized to: "obsolete: 8.5a6"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "fridolin"
    10. subsystem initialized to: "48. Number Handling"
    11. title initialized to: "Test expr-47.12 fails on linux"
    12. type initialized to: "Bug"
  2. Ticket change [056b5febd6] (rid 89061) by dgp on 2007-06-12 21:01:27:

    1. assignee changed to: "kennykb"
    2. closedate changed to: "2007-06-12T14:01:27"
    3. closer changed to: "dgp"
    4. icomment:
      Logged In: YES 
      user_id=80530
      Originator: NO
      
      
      Dup of 1609936?
      
      
    5. login: "dgp"
    6. mimetype: "text/plain"
    7. resolution changed to: "Duplicate"
    8. status changed to: "Pending"
    9. username: "dgp"
  3. Ticket change [ebcab26cb2] (rid 103590) by fridolin on 2007-06-15 19:24:12:

    1. 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).
      
      
      
      
    2. login: "fridolin"
    3. mimetype: "text/plain"
    4. status changed to: "Open"
    5. username: "fridolin"
  4. Ticket change [22a3d52fe3] (rid 130784) by kennykb on 2007-06-18 09:05:15:

    1. 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.
      
      
    2. login: "kennykb"
    3. mimetype: "text/plain"
    4. username: "kennykb"
  5. Ticket change [4f150c3051] (rid 125764) by fridolin on 2007-06-18 17:52:23:

    1. closedate changed to: "2007-06-18T10:52:23"
    2. closer changed to: "fridolin"
    3. 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).
      
      
    4. login: "fridolin"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"
    7. username: "fridolin"