Same source generates different object code for gcc 4.1.2
sudhakar govindavajhala
sudhakarg79spam@gmail.com
Fri Jan 27 21:49:00 GMT 2012
Hi all,
I am wondering why code generated by the same gcc 4.1.2 compiler on
the same source and the same machine generates different codes at
different times. I find this behavior very odd. Could someone please
add me some perspective on this?
The source code just includes <iostream>
Thanks,
Sudhakar
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-51)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
whychange.cc:
#include <iostream>
check.sh:
#!/usr/bin/bash
g++ -c -o whychange1.o whychange.cc
md5sum whychange1.o
objdump -D -S whychange1.o > 1.d
g++ -c -o whychange2.o whychange.cc
md5sum whychange2.o
objdump -D -S whychange2.o > 2.d
diff 1.d 2.d
More information about the Gcc-help
mailing list