POV-Ray : Newsgroups : povray.off-topic : Questionable optimizations : Re: Questionable optimizations Server Time
5 Sep 2024 13:14:58 EDT (-0400)
  Re: Questionable optimizations  
From: Tim Attwood
Date: 18 Jul 2009 15:54:32
Message: <4a622878$1@news.povray.org>
>  (Btw, AFAIK the C standard specifially says that a null pointer cannot
> contain a valid value. Thus the compiler can assume that it can't contain
> a valid value.)

The problem is that in C a null pointer is represented
by 0, but 0 is a valid memory address. So when you
have a valid pointer to address 0, then the optimizer
thinks you are checking for null, not for address 0.

It does seem bad to me to have a so much bloat
in the control switches for the GCC optimizer.
Take a look...
http://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Optimize-Options.html#Optimize-Options


Post a reply to this message

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