[RFA] libstdc++/22203, aka PowerPC vs numeric_limits<integer>::traps

Gabriel Dos Reis gdr@integrable-solutions.net
Thu Nov 10 00:50:00 GMT 2005


Benjamin Kosnik <bkoz@redhat.com> writes:

| > If PPC claims integer arithmetic does not trap then we do need
| > *testcases* to go with the patch.  The snipped provided in the PR does
| > not test anything.  We do need actual program that tests that the
| > operations don't trap.  With that modification, the patch is OK.
| 
| Well, it would certainly be nice to test this, but please note there
| are no signal or traps testing for numeric_limits presently.

Indeed, but all plateforms in that area have been declared trapping on
integers.

| Maybe Mr. Pinski has a clever idea about how to test this, since he
| must have run into something to find it?

In this specific case, the claim is that division by zero does not
trap.  I would think that 

     int main()
     {
        volatile int zero = 0;
        return 1 / zero;
     }

would run without delivering any signal, therefore should be included
in the patch (or variation of that).

-- Gaby



More information about the Libstdc++ mailing list