This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C PATCH] Don't leak C_MAYBE_CONST_EXPRs into fold() (PR c/68412)
- From: Marek Polacek <polacek at redhat dot com>
- To: Bernd Schmidt <bschmidt at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Joseph Myers <joseph at codesourcery dot com>, Jason Merrill <jason at redhat dot com>
- Date: Wed, 18 Nov 2015 17:58:05 +0100
- Subject: Re: [C PATCH] Don't leak C_MAYBE_CONST_EXPRs into fold() (PR c/68412)
- Authentication-results: sourceware.org; auth=none
- References: <20151118160348 dot GC21807 at redhat dot com> <20151118161624 dot GD21807 at redhat dot com> <564CA642 dot 8010801 at redhat dot com>
On Wed, Nov 18, 2015 at 05:24:34PM +0100, Bernd Schmidt wrote:
> That seems to change the behaviour of the code though. Most of the code in
> warn_tautological_cmp only looks at the unfolded form. Are you sure this is
> safe, for example wrt. the from_macro_expansion_at tests or the
> CONVERT_EXPR_P ones?
Of course the second version is wrong wrt CONVERT_EXPR_P, because it would
regress g++.dg/warn/Wtautological-compare.C -- with the fold() in the C++
FE we'd get rid of the CONVERT_EXPR_P completely and we'd warn.
Sorry :(. So I guess scratch the second version and let's get back to the
first one. Jason's r230471 was a correct thing to do.
Marek