Bill Hart wrote:
Leif, is this only exposed when the user manually sets an optimisation
level of -O3 or is it the default when MPIR builds on this system?

Nope, as mentioned in my previous post: ;-)

> [...] unfortunately (also) the library gets miscompiled.
>
> When I build the library with XOP instructions enabled and the test suite 
without, I'm getting the same five test failures with GCC 4.8.3, one less (i.e., 
only two) with GCC 4.9.0.
>
> Note however that this happens only with '-O3', otherwise GCC hardly ever 
emits XOP instructions at all (in my experience at least).


I would say that if you compile with -O3 you are asking for trouble.

Well, no risk, no fun. Actually the only flaw (in [recent] vanilla FSF GCCs) with '-O3' I'm currently aware of (or running into). (Ubuntu's and Debian's GCCs are similarly broken, but at least Ubuntu's in addition to other bugs...)


But if we do that by default, that's a different story.

I'd rather say it's something to mention in the release notes; if the user specifies C/CXXFLAGS, MPIR's currently get dropped anyway, so adding '-mno-xop' on bdver* wouldn't really help, although you could of course issue a warning.

Or /prepend/ MPIR's to user-specified ones... (That's what we currently do in Sage, but to achieve this, we have to dry-run MPIR's 'configure' once with CFLAGS and CXXFLAGS temporarily unset.)


-leif

On 16 June 2014 22:22, leif <not.rea...@online.de
<mailto:not.rea...@online.de>> wrote:

    Bill Hart wrote:

        I have uploaded alpha7 to our website (http://mpir.org).


    Just for the record:

    MPIR's test suite now exposes GCC's XOP-brokenness (I *think* that's
    new in alpha7, but probably already in alpha5 or 6).  AFAICT,
    there's not a single GCC version (supporting bdver*) that /isn't/ in
    some way broken w.r.t. XOP instructions, but so far MPIR wasn't
    affected (and GMP still isn't).

    So be prepared for respective bug reports... ;-)

    (Haven't checked yet whether just the test suite miscompiles, but I
    at least hope the library itself isn't affected.)


    -leif


    GCC 4.9.0, -march=bdver2 -mtune=bdver2 -O3 (all pass with -mno-xop):

    PASS: t-inv_divappr_q
    /bin/bash: line 1: 12856 Aborted                 "$tst" >
    t-inv_divappr_q_n.log-t 2>&1
    FAIL: t-inv_divappr_q_n
    /bin/bash: line 1: 12887 Aborted                 "$tst" >
    t-invert.log-t 2>&1
    FAIL: t-invert
    PASS: t-iord_u
    PASS: t-lorrshift1
    PASS: t-matrix22
    /bin/bash: line 1: 13011 Aborted                 "$tst" >
    t-mp_bases.log-t 2>&1
    FAIL: t-mp_bases
    PASS: t-mullow_basecase
    PASS: t-mullowhigh
    PASS: t-mulmid
    PASS: t-mulmod_2expm1
    PASS: t-mulmod_2expp1
    PASS: t-neg
    PASS: t-perfsqr
    PASS: t-redc_1
    PASS: t-sb_bdiv_q
    PASS: t-sb_bdiv_qr
    PASS: t-sb_div_q
    PASS: t-sb_div_qr
    PASS: t-sb_divappr_q
    PASS: t-scan
    PASS: t-subadd_n
    PASS: t-tdiv_q
    PASS: t-tdiv_qr
    PASS: st_fat
    PASS: st_instrument
    ==============================__==============================__=
    3 of 49 tests failed
    See tests/mpn/test-suite.log
    Please report to http://groups.google.co.uk/__group/mpir-devel/
    <http://groups.google.co.uk/group/mpir-devel/>
    ==============================__==============================__=


    ==============================__============
        MPIR 2.7.0: tests/mpn/test-suite.log
    ==============================__============

    3 of 49 tests failed.

    .. contents:: :depth: 2


    FAIL: t-inv_divappr_q_n (exit: 134)
    ==============================__=====

    failed:
    nn = 3084, dn = 1542, qn = 1542, rn = 2312

    
------------------------------__------------------------------__-------------------

    GCC 4.8.3, -march=bdver2 -mtune=bdver2 -O3 (all pass with -mno-xop):

    PASS: t-inv_div_q
    /bin/bash: line 1: 19233 Aborted                 "$tst" >
    t-inv_div_qr.log-t 2>&1
    FAIL: t-inv_div_qr
    /bin/bash: line 1: 19264 Aborted                 "$tst" >
    t-inv_div_qr_n.log-t 2>&1
    FAIL: t-inv_div_qr_n
    /bin/bash: line 1: 19295 Aborted                 "$tst" >
    t-inv_divappr_q.log-t 2>&1
    FAIL: t-inv_divappr_q
    /bin/bash: line 1: 19326 Aborted                 "$tst" >
    t-inv_divappr_q_n.log-t 2>&1
    FAIL: t-inv_divappr_q_n
    /bin/bash: line 1: 19357 Aborted                 "$tst" >
    t-invert.log-t 2>&1
    FAIL: t-invert
    PASS: t-iord_u
    PASS: t-lorrshift1
    PASS: t-matrix22
    PASS: t-mp_bases
    PASS: t-mullow_basecase
    PASS: t-mullowhigh
    PASS: t-mulmid
    PASS: t-mulmod_2expm1
    PASS: t-mulmod_2expp1
    PASS: t-neg
    PASS: t-perfsqr
    PASS: t-redc_1
    PASS: t-sb_bdiv_q
    PASS: t-sb_bdiv_qr
    PASS: t-sb_div_q
    PASS: t-sb_div_qr
    PASS: t-sb_divappr_q
    PASS: t-scan
    PASS: t-subadd_n
    PASS: t-tdiv_q
    PASS: t-tdiv_qr
    PASS: st_fat
    PASS: st_instrument
    ==============================__==============================__=
    5 of 49 tests failed
    See tests/mpn/test-suite.log
    Please report to http://groups.google.co.uk/__group/mpir-devel/
    <http://groups.google.co.uk/group/mpir-devel/>
    ==============================__==============================__=


    ==============================__============
        MPIR 2.7.0: tests/mpn/test-suite.log
    ==============================__============

    5 of 49 tests failed.

    .. contents:: :depth: 2


    FAIL: t-inv_div_qr (exit: 134)
    ==============================

    failed: remainder does not match

    --
    () The ASCII Ribbon Campaign
    /\   Help Cure HTML E-Mail

--
() The ASCII Ribbon Campaign
/\   Help Cure HTML E-Mail

--
You received this message because you are subscribed to the Google Groups 
"mpir-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mpir-devel+unsubscr...@googlegroups.com.
To post to this group, send email to mpir-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/mpir-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to