jkmcnk / sx-gcc

The GNU Compiler Collection port to NEC SX CPU architecture.
GNU General Public License v2.0
0 stars 2 forks source link

the modulo operation for "long long unsigned" type returns incorrect result #68

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The test below fails if compiled with sx-gcc:

{{{

extern void abort (void);

int test_remainder(long long unsigned a1, long long unsigned a2) {
    return a1 % a2;
}

main (int argc, char *argv[])
{
    long long unsigned a1 = 1234111117LL;
    long long unsigned a2 = 463LL;
    long long unsigned rem;

    rem = test_remainder(a1, a2);
    if (rem != 359LL)
        abort();
}

}}}

Due to this issue, the "gcc.c-torture/execute/920501-6.c" test case fails.

Original issue reported on code.google.com by nou...@gmail.com on 9 Dec 2008 at 9:11

GoogleCodeExporter commented 8 years ago
this is similar to issue 66; in this case, umoddi (I suppose long long is a DI 
mode
datum) insertion is wrong.

actually, DI division are wrong also, and most of DI integer arithmetic needs 
checking.

Original comment by jmoc...@gmail.com on 9 Dec 2008 at 9:17

GoogleCodeExporter commented 8 years ago
This issue is fixed with r159 corrections.

Original comment by nou...@gmail.com on 9 Dec 2008 at 1:44