Source files
sdrc yielded the same .sdr file in both cases.
 gcc 3.3.6
 gcc 4.0.2
 First analysis
In some areas gcc4 seems to yields expected results while gcc3 yields ugly results, however most of the parameters are left at their defaults value, especially self-intersection paramters and dicing level, which might be changed get nicer results, although there might be some bug hidden behind it too. I think gcc4 compiled giving better results is in fact a bug compensating for another bug/misconfiguration.
My interpretation of what is happening: the wall is black on the gcc3 image because of self-shadowing, because adding a shadowless or an ambient light would illuminate it, and removing the displacement shader makes the polygon behave normally on both cases. So, the wall showing on the gcc4 image is akin to the lack of proper shadow for the torus. This shows a ray intersection problem. Another problem, not related to the raytracer, is that somehow some buckets don't take the torus or the disk into account. So far I have only found consecutive buckets missing an object, which then appear normally (eg like on the torus here, you can see at which bucket the object "appeared").
It is not shown here, but at least cylinders and spheres behave normally, both hider-wise and raytracing-wise.
Wierd stuff: if I remove the torus, the wall gets black on the gcc4 render, behaving the same way as the gcc3 one. Moreover, moving the torus moves the shadowed part of the wall, but I could not find any correlation between the two movements.
This pretty much sums up what gcc-version-related differences I have found so far.
With gcc 3, everything goes smoothly from compilation to "make check". I did not use it because of lack of OpenGL and FLTK to compile exrdisplay and lack of time to find out what else I can do with it.
The sources of OpenEXR 1.2.2 do not compile with gcc 4. However, I heard gcc 4 is less tolerant with less-than-standard synatax than gcc 3. Indeed, it seems it was only a declaration through the "friend" statement that is no longer considered as a declaration, or not with the same scope. Anyway, adding
right after the #include block of exrmaketiled/Image.h is enough to make it compile smoothly, and "make check" works as well as with gcc 3.