http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53707
--- Comment #18 from Mikael Pettersson <mikpe at it dot uu.se> 2012-07-03 15:04:56 UTC --- Right, I understood that the C test case invoked implementation-defined behaviour, but inlining does invalidate any assumptions it might have made. Attaching an "__attribute__((__noinline__))" to find_stack_direction seems to make it work also with gcc-4.6.4 -O3.