http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48087
--- Comment #16 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2011-10-19 17:21:51 UTC --- (In reply to comment #15) > On this PR, removing the early return *works*, we have two non-bogus warnings > with -Wall and two errors with -Werror. Maybe we should really proceed one PR > at a time, re-open PR49508. I agree. This is what I meant by (2) above. That the bogus warnings are somehow hidden by gimple_push_cleanup, but it would be better to figure what gimple_push_clenaup is fixing and see whether it is possible to avoid generating it in the first place. If it is the same issue as PR49508, then fixing (1) is not enough. > Now, in detail: do I understand correctly that you are proposing we would use > the new seen_real_errors *only* in gimple_push_cleanup? (at the moment I also > honestly don't know how to tell errors from warnings from real errors, but of > course can figure out myself) I would search where the counters are defined and add a new one for real_errors. Then, for warnings converted to errors, do not increase the new one. This should be a one-liner in diagnostic_report_diagnostic. Search for diagnostic_kind_count. This would maintain seen_error working as it is now, but one can define program_is_valid_p (or seen_real_error).