problem with CFLAGS=-O2

David Relson relson at osagesoftware.com
Wed Sep 18 00:15:15 CEST 2002


<x-flowed>
Greetings,

I have two versions of bogofilter.c which contain trivially different 
versions of function select_indicators().  Here's the diff:

[relson at osage bogofilter]$ diff bogofilter.assign.c bogofilter.printf.c
726c726
< 	if (verbose >= 300) verbose += 1;
---
 > 	if (verbose >= 300) printf( nl ) ;

Since verbose is always small (approx 0-5) neither the assignment nor the 
printf() is actually executed, and the coding difference should have no 
effect.

Using a particular test.msg I have and compiling with the bogofilter 
default of "CFLAGS=-g -O2", the two program versions give different 
spamicity numbers.  When compiled with "CFLAGS=-g" or "CFLAGS=-g -O1", the 
programs give the same spamicity numbers.  Here's a chart that shows what I 
mean:

	CFLAGS		assign.c	printf.c

	-g		0.990000	0.990000
			Spam		Spam

	-g -O1		0.990000	0.990000
			Spam		Spam

	-g -O2		0.000000	0.990000
			Non-Spam	Spam


-O2 gives the same result with gcc-2.96, gcc-3.0.0, and gcc-3.2.  Looks 
like I need to report this to the gcc folks.  For our purposes, I think we 
need to change the configure script, which determines the value of CFLAGS 
for Makefile.

David

</x-flowed>



More information about the bogofilter-dev mailing list