Can you post here:
* version of GCC (it was GCC, right?) you used
* OS version
* CPU type and mode (32-bit? 64-bit?)
* optimization settings (were -O3, right?)
If you have time, can you replace
Code:
printf("0/66\n");
_TestResult = true;
for(_spoil_scenario=-1; _spoil_scenario<7; _spoil_scenario++)
in the beginning of test_i.cpp by
Code:
printf("0/66\n");
_TestResult = true;
for(_spoil_scenario=-1; _spoil_scenario<0; _spoil_scenario++)
any try to compile/execute test one more time. Did it still outputs "matinv_d_r1 FAILED"? (matinv_
d_r1, not matinv_
c_r1; former may disappear, while latter will remain).
_spoil_scenario variable is an index of crash test applied to the function being investigated. -1 means than we just try to calculate result without crash tests, values from 0 to 6 denote different ways of spoiling inputs with NAN/INF or resizing arguments. I suspect that there is a bug in handling of
exceptional situations, but normal execution should be OK.
I also suspect that it can be GCC's bug, because recently I've discovered one which was related to the same topic - handling of complex conversions between doubles, pointers, ints, which were needed to detect NAN/INF in efficient and portable manner. For example, following code was working under -O0 and -O1 (and under MSVC with any king of optimization settings), but failed under GCC with -Os:
Code:
void ae_state_init(ae_state *state)
{
double a;
ae_int32_t *p;
.......................
/*
* determine endianness and initialize precomputed IEEE special quantities.
* two types are supported: big-endian and little-endian.
* mixed-endian hardware is NOT supported.
*
* 1983 is used as magic number because its non-periodic double
* representation allow us to easily distinguish between upper
* and lower halfs and to detect mixed endian hardware.
*
*/
a = 1.0/1983.0;
p = (ae_int32_t*)(&a);
if( p[1]==(ae_int32_t)0x3f408642 )
{
......... little endian hardware .........
}
else if( p[0]==(ae_int32_t)0x3f408642 )
{
..................... big endian hardware .............
}
else
{
................ place were GCC with -O3 sometimes sends us ..............
}
}
This bug was fixed in ALGLIB 3.0.0 (code was rewritten to avoid triggering it), but maybe there are another possibilities to step into it.