http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60062
--- Comment #5 from Zhendong Su <su at cs dot ucdavis.edu> --- (In reply to Jakub Jelinek from comment #4) > *** Bug 60072 has been marked as a duplicate of this bug. *** The testcase below is most likely another dup as the only difference is that it affects the trunk at -Os only. Just include it here for reference. Thanks. ---------------------------------- int printf (const char *, ...); int a; int fn1 (unsigned char p1) { return p1 % p1; } static void fn2 (char *p1, int p2) { if (p2) printf (p1); } __attribute__ ((optimize (0))) int fn3 (short p1, short p2) { a = 0; return 0; } __attribute__ ((optimize (1))) int fn4 () { fn3 (0, 0); if (fn1 (1)) for (;;) ; return 1; } __attribute__ ((optimize (0))) int main () { fn4 (); fn2 ("", 0); return 0; }