On 13 Aug 2014, ste...@agner.ch wrote:

> Funny is, the size is bigger in the first uninlined case... Maybe GCC
> inlined the function only for some calls, I did not checked that... 
>
> With if/else
> text     data     bss     dec     hex filename
> 2395     2904       0    5299    14b3 drivers/mtd/nand/fsl_nfc.o

This is totally sensible.  In some cases, the function epilogue and
prologue are actually bigger than the function body.  Also, the implicit
call means that the caller must save some temporary registers (R0-R3).
For the simple nfc_read() and nfc_write(), I would expect the size to
get bigger if they are not inlined.  Especially, gcc can recognize that
the same memory location is being operated on and collapse the
accesses.

Anyways, thanks for showing that the previous code was depending too
much on compiler knowledge.  Your current plan sounds promising.

Regards,
Bill Pringlemeir.
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to