How does GCC decide what order to output assembly functions in?

Viewed 856

Reading through the assembly GCC generates for C files in my project, I notice functions are not outputted in assembly in the same order they appear in the source file. What is the goal of this reordering and what heuristics does GCC use to decide the order? (Is it just an artifact of the data structure holding functions?) This is not -freorder-functions, since I'm not using -fprofile-arcs.

1 Answers
Related