This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/86586] [6/7/8/9 Regression] -Wsign-compare affects code generation
- From: "amonakov at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 19 Jul 2018 16:24:16 +0000
- Subject: [Bug c++/86586] [6/7/8/9 Regression] -Wsign-compare affects code generation
- Auto-submitted: auto-generated
- References: <bug-86586-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86586
--- Comment #7 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
Another possible compromise is to add 'bool for_warnings = false' argument to
maybe_constant_value, store it along with the reduced tree in cv_cache (perhaps
even by setting a flag on the tree itself?), and then when retrieving from
cv_cache when !for_warnings, but the retrieved tree has the flag set, throw it
away and recompute.
That should be a fairly simple change that keeps the current speed when the
warnings are disabled or main code generation needs the reduced tree before
some of the warnings do.