http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57358
--- Comment #2 from Nickolay Kolchin-Semyonov <nbkolchin at gmail dot com> --- More simplified test variant: struct t { void (*func)(void*); }; void test_func(struct t* a) __attribute__((optimize("O0"))); void test_func(struct t* a) { a->func(0); } P.S. If you compile this as C++ code, no segmentation fault would occure.