[Insight-developers] NrrdIO failures at iowa site

Hans Johnson hans-johnson at psychiatry.uiowa.edu
Tue Feb 8 17:59:35 EST 2005


All,
                                                                                
I've been tracking down the errors in NrrdIO tests on the iowa builds.
It seems that the code violates some aliasing assumptions and is not
robust under certain optimization schemes (the newer gcc compilers
recognize the situation and will give a warning).
                                                                                
I've resolved the problems by avoiding the aliasing all together. Below
is the test case used to illustrate the problem when determining the
TEEM_QNANHIBIT value from Insight/CMake/TestQnanhibit.c . Similar
changes need to be made in Insight/Utilities/Nrrd/754.c to make the
testing of double and single precision infinity more robust to
optimizations.
                                                                                
I've taken to using the "finite" and "isnan" functions if they are
defined in math.h and falling back to the old method if they are not
defined. The "finite" and "isnan" functions from glibc have similar
union'ing code to that implemented in the new version of
TestQnanhibit.c, and avoid the aliasing problems.
                                                                                
Patches are included at the very end of this message.
                                                                                
Regards,
Hans J. Johnson
hans-johnson at uiowa.edu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: note
Type: application/octet-stream
Size: 11138 bytes
Desc: not available
Url : http://www.itk.org/mailman/private/insight-developers/attachments/20050208/d73ce3c6/note.obj


More information about the Insight-developers mailing list