Configured with: ../configure --enable-languages=c Thread model: posix gcc version 3.4.0 GCC 3.4.0 seems to inline some nested functions, but sometimes it does not remove the standalone definitions of them even if they are not referred at all. This increases the binary size unnecessarily. I compiled my C source file in this way: /usr/local/bin/gcc -c -Os -save-temps nested.c I checked the object file by objdump. This is a small version of the source file which reproduces the same result: ---------------------------------------------------------- int next_partition (unsigned long drive, unsigned long dest, unsigned long *partition, int *type, unsigned long *start, unsigned long *len, unsigned long *offset, int *entry, unsigned long *ext_offset, char *buf) { auto int next_bsd_partition (void); auto int next_pc_slice (void); int next_bsd_partition (void) { return 0; } int next_pc_slice (void) { return 1; } if (*partition != 0xFFFFFF) { return next_bsd_partition (); } return next_pc_slice (); } ---------------------------------------------------------- Even though the function next_partition does not call next_bsd_partition.0 or next_pc_slice.1 in the object file, their defnitions are left.
Created attachment 6583 [details] The preprocessed file of my source file This is a small version of my source file which reproduces the same result.
Fixed on the mainline, by the unnested functionality of the tree-ssa.