This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/48087] [4.5/4.6/4.7 Regression] -Wall -Werror adds warnings over and above those generated by -Wall
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 19 Oct 2011 01:44:12 +0000
- Subject: [Bug middle-end/48087] [4.5/4.6/4.7 Regression] -Wall -Werror adds warnings over and above those generated by -Wall
- Auto-submitted: auto-generated
- References: <bug-48087-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48087
--- Comment #12 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2011-10-19 01:44:12 UTC ---
I think the problem is the seen_error() test in gimple_push_cleanup. I am
guessing that it does some kind of "folding" that is skipped when an error has
been issued. There are two issues here:
1) Warnings converted to errors are not real errors, that is, the program is
still valid and we could in principle do whatever stuff we would do for a valid
program. We could do s/seen_error/seen_any_error/, and then add seen_real_error
(program_is_invalid). I bet most of the cases using seen_any_error, actually
mean program_is_invalid.
2) Whether even with real errors, we can fix the gimple generated by C++ to not
trigger the Wreturn-type warning. Or alternatively, make Wreturn-type more
intelligent to not emit a bogus warning here. The point here is that it is
perhaps possible to generate such a gimple from C++ that causes a bogus
warning. Currently, gimplify_push_cleanup "fixes" the bad gimple to avoid the
warning, but perhaps in other testcases, this "fix" doesn't trigger and we get
a bogus warning.
The thing is that even if we fix 1, we could probably trigger a real error
earlier and we end up with 2 (no inconsistency, but still bogus warning).