gcc-4.3 optimizer bugs?

Jakub Jelinek jakub at redhat.com
Wed Feb 27 10:59:20 UTC 2008


On Wed, Feb 27, 2008 at 05:45:34AM -0500, Neal Becker wrote:
> We are trying to track down a numerical problem with unuran that occurs on
> gcc-4.3.  I know that gcc now has a very extensive test suite, and bugs are
> not common.  I'm just wondering, are others finding similar problems with
> gcc-4.3?
> 
> We are working on preparing a bug report.  The symptoms are:
> 1) Problem disappears if -O0
> 2) Problem disappears if a printf is added
> 3) valgrind is silent

If it is on i?86, might very well be a problem caused by excess precision.
Try -O2 -msse2 -mfpmath=sse to see if it helps, you likely need some
volatile temporaries to ensure results are rounded down to the desired float
resp. double precision (when results are kept within FP stack, they use
extended precision).
If not, using binary search between -O0 and -O2 objects you can easily
find the problematic object and with some extra effort even the problematic
function.  Create a self-contained testcase from it (main calling the
problematic function with some arguments that reproduce it (if needed make
it __attribute__((noinline)), add stubs for functions the problematic
function calls) and report.

	Jakub




More information about the fedora-devel-list mailing list