Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Better compiler optimizations

Closed / Fixed218147ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:53:45
OriginalBugID: 2139 RFE
Version: 8.1
SubmitDate: '1999-06-03'
LastModified: '1999-12-03'
Severity: LOW
Status: Closed
Submitter: techsupp
ChangedBy: hobbs
OS: Solaris
OSVersion: 7
Machine: Other
FixedDate: '2000-10-25'
ClosedDate: '1999-12-03'


Name:
Timothy Miller

CustomShell:
The "patch" was just the compiler optimization mentioned above.

DesiredBehavior:
We use UltraSparc here a lot, and it would be nice if more developers
    would make better use of the Sparc compiler.  Instead of "-O", we here
    use the following optimization:
        CFLAGS_OPTIMIZE =       -fast -xO4 -xdepend -xchip=ultra
    -xarch=generic
    
    I have compiled tcl using these flags on my Solaris 7 box with the
    latest Sparc Workshop.  I have run the test suite on it, and these are
    the results:
    
    Tests ended at Thu May 27 11:19:40 EDT 1999
    all.tcl:        Total   8472    Passed  7740    Skipped 725     Failed
    7
    Sourced 117 Test Files.
    Files with failing tests: event.test io.test thread.test
    Number of tests skipped for each constraint:
            15      95
            16      doTestsWithRemoteServer
            48      emptyTest
            27      knownBug
            122     macOnly
            151     nonPortable
            16      nt
            327     pcOnly
            1       umask2
            2       unixOnly && !testthread
    Warning: test files left files behind:
            httpold.test:   httpd
    
    The failures were:
    
    ==== thread-4.4 TclThreadSend preserve code FAILED
    ==== io-50.6 testing handler deletion vs reentrant calls FAILED
    ==== io-50.5 testing handler deletion vs reentrant calls FAILED
    ==== io-50.4 testing handler deletion vs reentrant calls FAILED
    ==== io-50.3 testing handler deletion with multiple handlers FAILED
    ==== io-50.2 testing handler deletion with multiple handlers FAILED
    ==== event-1.1 Tcl_CreateFileHandler, reading FAILED
    
    I don't know if those are expected.  Given my past successful experience
    with these optimizations on such things as the MIT X11R6.1, I would
    suspect that these failures would occur with the normal "-O"
    optimization, although I haven't tried it.  I don't believe there were
    any core dumps.
    
    Next, I did wish, with the same optimization for UltraSparc.  I ran the
    test suite and got these three failures:
    
    ==== winfo-13.4 [winfo containing] with embedded windows FAILED
    ==== unixEmbed-5.1 EmbedFocusProc procedure, FocusIn events FAILED
    ==== focus-6.1 miscellaneous - embedded application in same process
    FAILED
    
    Again, no core dumps, and I don't know if these failures are relevant.
    
    These extra optimization options result in considerable performance
    improvement over -O or -O2.  It might be worth the while of you and your
    users to use that.  And for that matter, you can use -O3 for gcc also
    which may yield some performance improvements.
    
    If you have any support for 64-bit systems and account for the fact that
    "long" and pointers are 64-bit on these systems and would like to try it
    for UltraSparc (Solaris 7 on a Sparc v9 architecture), you would need to
    add this option to the above:
        -xarch=v9 -xregs=no%appl
    
    Happy coding.



Users are welcome to change the optimization level themselves,
but this is not recommended practice in general, as not all
compilers support more than -0, or support it stably. 
-- 12/03/1999 hobbs
welch Closed ticket [218147ffff]. [History diff]2000-10-26 08:15:56
dgp Ticket [218147ffff]: 3 changes [History diff]2001-04-18 06:30:05
Log in (anonymous is fine) to add a comment.