John Regehr points out this size-regression WRT 3.4: Sometimes a function modifies globals but even so has no net effect:
http://embed.cs.utah.edu/embarrassing/jan_10/harvest/source/8A/8AB0B238.shtml http://embed.cs.utah.edu/embarrassing/jan_10/harvest/source/14/14157FE8.shtml Somehow gcc3 sees these but everyone else including gcc4 fails. $ cat 8AB0B238.c struct frame_info; struct frame_info; struct frame_info; struct frame_info; struct frame_info; struct frame_info; struct frame_info; struct frame_info; struct frame_info; void tui_registers_changed_hook (void); extern struct frame_info *deprecated_selected_frame; int tui_refreshing_registers = 0; void tui_registers_changed_hook (void) { struct frame_info *fi; fi = deprecated_selected_frame; if (fi) { if (tui_refreshing_registers == 0) { tui_refreshing_registers = 1; tui_refreshing_registers = 0; } } return; } $ for i in 3.4 4.4 4.5.orig-HEAD;do gcc-$i -fomit-frame-pointer -Os -c -o 8AB0B238.o-gcc-$i 8AB0B238.c;done $ size 8AB0B238.o* text data bss dec hex filename 1 0 4 5 5 8AB0B238.o-gcc-3.4 29 0 4 33 21 8AB0B238.o-gcc-4.4 29 0 4 33 21 8AB0B238.o-gcc-4.5.orig-HEAD -- Summary: DSE fails: no-op modification of global data pessimized code-size Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: aldot at gcc dot gnu dot org OtherBugsDependingO 16996 nThis: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42899