https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90967
Bug ID: 90967 Summary: -Os produces more code than -O1 Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: oliverst at online dot de Target Milestone: --- Created attachment 46512 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46512&action=edit example code The attached code produces an empty main when compiled with -std=c++11 -Os in GCC 4.9.4. Starting with GCC 5.1.0 it will produce code involving a basic_string move constructor. When compiled with -O1 it will always produce an empty function.