Re: Understand the running time of a program compiled with GCC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Eljay,

On 10-3-10 下午8:04, John (Eljay) Love-Jensen wrote:
> Hi Zheng Da,
> 
>> Can anyone tell me what is the possible reason that can cause time difference?
> 
> To understand the differences, look at the assembly dumps of the routine from the GCC compiler and the Intel compiler.
It's not a big program, but not a small one either. I used objdump -S to see the
assembly code and two files are almost completely different. But I noticed one
thing: the binary file generated by the Intel compiler is much larger than the
one from GCC. Another thing I have noticed is that with -O3 enabled, the Intel
compiler generate vector instructions but GCC doesn't. But I don't see how this
can explain my problem.
> 
> Make sure you are using the right GCC machine flags -mcpu= -mtune= -march= for your platform.  (Since you did not provide your command lines for GCC and Intel compilers, I can only offer that as a general suggestion.)
I didn't use any of these machine flags. I only used -O3 for GCC and Intel
compiler. So the command line I used to compile my program is
gcc -fopenmp -DREALTIME -D__LINUX -lm -O3 MORGAN2.c -o MORGAN2-omp
icc -openmp -DREALTIME -D__LINUX -O3 MORGAN2.c -o MORGAN2-omp

I use Athlon ii x4 620 processor, so I tried -mtune=athlon or -mtune=athlon-4 or
-mtune=athlon64 or -mtune=native -march=native when I compiled the code with
GCC, but none of them seems to work:-(

Best regards,
Zheng Da

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux