What happened when using -Os with gcc?

Tech Win tech_win@shaw.ca
Thu Jul 2 03:09:00 GMT 2009


I have to bear with GCC 3.4.6 because I don't have permission to upgrade it.

The thing is this piece of code doesn't work if putting it in our system and
with the -Os option, if I try it separately, seems okay. Maybe you suspect
it's our system's bug, but if I don't use gcc optimization (-O0), or use
-O1, -O2, -O3, all no problem.

-----Original Message-----
From: Ian Lance Taylor [mailto:iant@google.com] 
Sent: July 1, 2009 19:34
To: Tech Win
Cc: gcc-help@gcc.gnu.org
Subject: Re: What happened when using -Os with gcc?

"Tech Win" <tech_win@shaw.ca> writes:

> But if I use -Os when compiling, the result is: 
> ================= LAST =============== 
> 1 --- 1 
> 1 --- 0 
> 1 --- 0 
> t=2525.00

This certainly suggests a bug in the compiler.


> My GCC version is 3.4.6.

I tried 4.3.2 on i686-unknown-linux-gnu, and it worked as expected with
both -O2 and -O2.

The current version of gcc is 4.4.0.

Ian
Checked by AVG - www.avg.com 
Version: 8.5.375 / Virus Database: 270.13.2/2213 - Release Date: 07/01/09
18:07:00



More information about the Gcc-help mailing list