Determine stack usage from files generated by gcc by creating callgraph, evaluating map file and stack usage files.
To use this tool, you need to add additional command line parameters to GCC and LD and keep using your standard options and optimisations.
CFLAGS += -fdump-rtl-expand -fstack-usage
LDFLAGS += -Wl,-Map
After full rebuild, point this tool to directory, where are *.su, *.expand and *.map files.