[SDL] re: SDL parachute usage or dodgy compiler optimisation

Andrew Beardmore apb at astro.keele.ac.uk
Tue Oct 2 20:06:00 PDT 2001


>> [snip]
>> Is there a known problem with optimised code generated by RH6.2  (compiler
>> version egcs-2.91.66)  Or have I got a lot more head scratching to go
>> through before I nail this one

> Also, O2 is more tested than O0, so the culprit is more likely your
> program than an odd optimization. (Optimization exposes some obscure
> bug in code). The long delay before the fault may relate to a memory leak
> or dangling pointer reference.

Memory usage seems stable when monitored with top.

The code is actually a particle system simulation written in c++ (heavy
use of templates and inlining). By running it on RH6.2 (compiled with -g
-O2, remember it doesn't segfault with -O1 or -O0)  under gdb I found out
it choked in the ODE integrator and spewed out a NaN.

However, I've since got my hands on a RH7.1 box and it runs fine, no NaNs,
no segfaults, nothing to debug  (famous last words I'm sure!) with
optimisation set at -O2 or -O3.

So it works on Mandrake 8.0 and RH7.1, and fails on RH6.2 (with anything
higher than -O1).

I'm  quite happy to leave it as "a compiler issue".

Now I've just got to persuade our system administrator to upgrade my
pc to RH7.1  - I've been trying for 4 months so don't hold at much
hope....

Cheers,
Andy.






More information about the SDL mailing list