http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57200
Bug #: 57200 Summary: [4.8/4.9] aggressive-loop-optimizations notes appear even when warning itself is suppressed Classification: Unclassified Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassig...@gcc.gnu.org ReportedBy: ppluzhni...@google.com Test: int x[10]; void fn () { int i; for (i = 0; i < 100; ++i) x[i] = 1; } Using trunk at r198689: gcc -O2 -c t.c t.c: In function ‘fn’: t.c:8:10: warning: iteration 10u invokes undefined behavior [-Waggressive-loop-optimizations] x[i] = 1; ^ t.c:7:3: note: containing loop for (i = 0; i < 100; ++i) ^ Looks good. But this doesn't: gcc -O2 -c t.c -w t.c: In function ‘fn’: t.c:7:3: note: containing loop for (i = 0; i < 100; ++i) ^ A note suddenly appears from "nowhere" :-(