Here is a 20 % increase code size, because the compiler tries too much to jump to UI_plotHline() instead of just calling the function and then doing a standard return at the end of drawbutton()...
[EMAIL PROTECTED] projet]$ cat tmp.c typedef struct { unsigned short x, y; /* x should be the easyest to read */ } __attribute__ ((packed)) coord; extern inline void UI_plotHline (coord xy, unsigned short xend, unsigned color) { extern UI_function_plotHline (coord xy, unsigned xend, unsigned color); UI_function_plotHline (xy, xend, color); } extern inline void UI_setpixel (coord xy, unsigned color) { extern UI_function_setpixel (coord xy, unsigned color); UI_function_setpixel (xy, color); } extern inline void bound_stack (void) { /* * limit included - but add 2 to high limit for reg16, and 4 for reg32 * if not in bound, exception #BR generated (INT5). * iret from INT5 will retry the bound instruction. */ extern unsigned STATE_stack_limit; asm volatile (" bound %%esp,%0 " : : "m" (STATE_stack_limit) ); } void drawbutton (coord upperleft, coord lowerright, unsigned upperleftcolor, unsigned lowerrightrcolor, unsigned fillcolor, unsigned drawbackground) {bound_stack();{ /* Enlarge the button by few pixels: */ upperleft.x -= 2; lowerright.x += 2; lowerright.y -= 1; /* do not overlap two consecutive lines */ UI_plotHline (upperleft, lowerright.x, upperleftcolor); /* top line */ /* do not change VESA1 banks too often, process horizontally, left to right, line per line */ for (;;) { upperleft.y += 1; if (upperleft.y >= lowerright.y) break; UI_setpixel (upperleft, upperleftcolor); if (drawbackground) UI_plotHline (((coord) { .x = upperleft.x + 1, .y = upperleft.y }), lowerright.x - 1, fillcolor); UI_setpixel (((coord) { .x = lowerright.x - 1, .y = upperleft.y }), lowerrightrcolor); } UI_plotHline (upperleft, lowerright.x, lowerrightrcolor); /* bottom line */ }} [EMAIL PROTECTED] projet]$ gcc -v Using built-in specs. Target: i386-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=i386-redhat-linux Thread model: posix gcc version 4.1.0 20060304 (Red Hat 4.1.0-3) [EMAIL PROTECTED] projet]$ gcc -Os -c tmp.c && size *.o text data bss dec hex filename 276 0 0 276 114 tmp.o [EMAIL PROTECTED] projet]$ toolchain-3.4.5/bin/gcc -v Reading specs from /home/etienne/projet/toolchain-3.4.5/bin/../lib/gcc/i686-pc-linux-gnu/3.4.5/specs Configured with: ../configure --prefix=/home/etienne/projet/toolchain --enable-languages=c Thread model: posix gcc version 3.4.5 [EMAIL PROTECTED] projet]$ toolchain-3.4.5/bin/gcc -Os -c tmp.c && size *.o text data bss dec hex filename 227 0 0 227 e3 tmp.o [EMAIL PROTECTED] projet]$ -- Summary: 20 % increase code size in 4.1 vs 3.4.5, tail return optimisation Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: etienne_lorrain at yahoo dot fr GCC build triplet: i386-redhat-linux GCC host triplet: i386-redhat-linux GCC target triplet: i386-redhat-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27357