Actually, it doesn't seem to be related to statement expressions at all. Plain void g (void); double f (void) { g (); return; } shows this at all optimization levels (though removing return makes it go away). Investigating...