POV-Ray : Newsgroups : povray.programming : GCC bug manifested in Colour Patch : GCC bug manifested in Colour Patch Server Time
29 Jul 2024 02:29:06 EDT (-0400)
  GCC bug manifested in Colour Patch  
From: Daren Scot Wilson
Date: 30 Nov 1998 12:16:06
Message: <36629AE0.933484D5@pipeline.com>
This isn't the right forum to discuss gcc bugs, but I don't want anyone
looking at my patch, wondering why there's this strange line in there,
thinking I'm insane.  Well, I mean, of course I *am* insane, just not
for that reason...   :-P


I made a discovery concerning the GNU C compiler - it has  a bug!   If
you look at the source code in my Colour Dispersion patch, you'll see a
line that goes

        strcat("A", 'a');

which accomplishes nothing, except that if it's removed and certain
compiler optimizations are turned on, POV-Ray will incorrectly render
refraction.  I hope to narrow POVRay down to a simple few-line test
program and pass it on to the GCC developers.  

The optimizations I used were:
   -O2 -mpentium -finline-functions

The problem goes away if (1) you change to -O1;  (2) your remove
-finline-functions; or (3) you insert an arbitrary call to a C library
function, such as printf or some string function, at a certain place in
the source code.

The gcc I use is version 2.8.1, compiled from source with pentium
optimizations.  I haven't even gotten as far as looking for the official
bug list for gcc.  


-- 

Daren Scot Wilson
Member, ACM
dar### [at] pipelinecom
www.newcolor.com
--
"A ship in a harbor is safe, but that is not what ships are built for"
                     -- William Shedd


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.