http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57018
Bug #: 57018 Summary: Miscompilation of bison 2.7.1 under "-Os -fomit-frame-pointer" Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassig...@gcc.gnu.org ReportedBy: mich...@talamasca.ocis.net Created attachment 29906 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29906 Code to generate a pair of objects showing the bug GCC 4.8.0 miscompiles bison 2.7.1 when compiling for space with frame pointer omission. (I've built gcc with --enable-frame-pointer expressly so my code isn't bloated with exception data when I omit it on the command line.) There are multiple breakages, but I've nailed down one of them in the attached case. It seems to involve the combination of passing structures by value and the optimization opportunities of functions not called from outside an object. So long as extenal_noop does nothing, calling real_entry_point should always result in its argument being copied to main_blob. But main_blob is full of garbage at the problematic optimization "-Os -fomit-frame-pointer". This is on i386-pc-linux-uclibc.