------- Comment #10 from steven at gcc dot gnu dot org 2008-11-22 11:36 ------- Trunk today generates the following code (this is the final_cleanup dump):
;; Function foo (foo) foo () { static char eof_reached = 0; int bytes; int toread; <bb 2>: toread = 4096; <bb 3>: bytes = bar (toread); if (bytes <= 0) goto <bb 4>; else goto <bb 5>; <bb 4>: if (bytes != 0) goto <bb 6>; else goto <bb 7>; <bb 5>: toread = toread - bytes; <bb 6>: if (toread != 0) goto <bb 3>; else goto <bb 8>; <bb 7>: eof_reached = 1; <bb 8>: return; } Looks like we can't do any better than that -- can we?? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21559