This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc 4.1 -O1 problem


On Wed, Mar 15, 2006 at 09:57:13PM -0800, Ian Lance Taylor wrote:
> Kevin Shanahan <kmshanah@disenchant.net> writes:
> > Are there any other options besides these which -O1 affects?
> 
> -O1 is unfortunately not the sum of individual options.  The compiler
> often simply checks whether you are optimizing at all, rather than
> checking specific options.

Okay, thanks anyway. I found out that the signed char cast in this
snippet of code changed behaviour with -O1:

    int snd_scaletable[32][256];
    int i, j;

    for (i = 0; i < 32; i++)
	for (j = 0; j < 256; j++)
	    snd_scaletable[i][j] = ((signed char)j) * i * 8;

I made the value explicit as '(j < 128) ? j : j - 256' instead.

Cheers,
Kevin.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]