-
-
I would like to know why there is a difference in function prologue generated for same function with clang and gcc.
Compiler options used for gcc were as follows: arm-linux-gnueabi-gcc all-types.c -w -march=armv7-a -mtune=cortex-a8 -mfloat-abi=softfp -mfpu=vfp -g -lm -o all-types_gcc Compiler options used for clang were as follows: /usr/local/bin/clang all-types.c -w -ccc-gcc-name arm-linux-gnueabi-gcc -ccc-host-triple arm-linux-gnueabi -ccc-clang-archs arm -march=armv7-a -mtune=cortex-a8 -mfloat-abi=softfp -mfpu=vfp -g -lm -o all-types Dissassembly of main() from all-types.c compiled with GCC. 00008448 <main>: float v_float; double v_double; int main () { 8448: e92d4800 push {fp, lr} 844c: e28db004 add fp, sp, #4 extern void dummy(); #ifdef usestubs set_debug_traps(); breakpoint(); #endif dummy(); 8450: eb000002 bl 8460 <dummy> return 0; 8454: e3a03000 mov r3, #0 } 8458: e1a00003 mov r0, r3 845c: e8bd8800 pop {fp, pc} 00008460 <dummy>: void dummy() { 8460: e52db004 push {fp} ; (str fp, [sp, #-4]!) 8464: e28db000 add fp, sp, #0 /* Some linkers (e.g. on AIX) remove unreferenced variables, so make sure to reference them. */ v_char = 'A';
Raw dump of debug contents of section .debug_line: Offset: 0x0 Length: 74 **DWARF Version: 2** Prologue Length: 34 Minimum Instruction Length: 2 Initial value of 'is_stmt': 1 Line Base: -5 Line Range: 14 Opcode Base: 13
-
all-types.c (1.03 KB)