lkml.org 
[lkml]   [1996]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subjectgcc-2.7.2's optimizations
Hi,

the gcc gurus will probably know already, but maybe it's interesting
for some:

Yesterday I tried to "optimize" a piece of code. According to Linus'
suggestions I wanted to compare the assembler output, but *surprise*
the was not a sigle byte different! I could not believe it and
compiled again; no difference. I did not know that gcc is that smart
already. Here's the patch that does not make any difference with the
default compilation options:

--- time.c 1996/10/15 19:15:18 1.5
+++ time.c 1996/10/16 19:31:05 1.7
@@ -548,10 +548,10 @@
{
time_adjust = txc.offset;
}
- else if ((time_status & STA_PLL)||(time_status & STA_PPSTIME))
+ else if ( time_status & (STA_PLL | STA_PPSTIME) )
{
- ltemp = (time_status & STA_PPSTIME &&
- time_status & STA_PPSSIGNAL) ?
+ ltemp = (time_status & (STA_PPSTIME | STA_PPSSIGNAL)) ==
+ (STA_PPSTIME | STA_PPSSIGNAL) ?
pps_offset : txc.offset;

/*

Ulrich Windl

\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.040 / U:2.620 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site