This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH RFA: C++ frontend: Don't warn about shifts which will not be run
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: Jason Merrill <jason at redhat dot com>, gcc-patches at gcc dot gnu dot org, Mark Mitchell <mark at codesourcery dot com>
- Date: Fri, 12 Jun 2009 23:19:27 +0000 (UTC)
- Subject: Re: PATCH RFA: C++ frontend: Don't warn about shifts which will not be run
- References: <m31vppe20p.fsf@google.com> <4A32BA2C.4060309@redhat.com> <m3k53haxgm.fsf@google.com>
On Fri, 12 Jun 2009, Ian Lance Taylor wrote:
> -/* Nonzero means the expression being parsed will never be evaluated.
> - This is a count, since unevaluated expressions can nest. */
> +/* Nonzero means the expression being parsed will never be
> + evaluated. */
Pre-existing condition, but this is not accurate. skip_evaluation is a
*heuristic* to avoid spurious warnings; it's set inside sizeof even though
we don't know until after the whole expression/type inside sizeof has been
parsed whether it's actually sizeof(VLA) which is evaluated.
I'm not convinced the distinction you are making here between
unexecuted/unevaluated is a very well-defined one for C, although such
concepts do appear in the standard to some extent (6.9 considers only
expressions inside sizeof-non-VLA while 6.6#3 has a less precisely defined
"not evaluated" for constant expressions that includes at least the
example 2 || 1 / 0). The implementations of these two distinct concepts
in GCC are quite complicated, and separate from the heuristic
skip_evaluation.
--
Joseph S. Myers
joseph@codesourcery.com