This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Move out-of-bound case labels warning to the C front end
- From: "Joseph S. Myers" <jsm at polyomino dot org dot uk>
- To: Steven Bosscher <stevenb at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 19 Jul 2004 20:43:27 +0000 (UTC)
- Subject: Re: Move out-of-bound case labels warning to the C front end
- References: <200407192232.19215.stevenb@suse.de>
On Mon, 19 Jul 2004, Steven Bosscher wrote:
> BTW the original reason for adding this code in expr.c was that on
> the tree-ssa branch we optimize away the default promotion from
> char to int if the switch testing expression is a char. This used
> to trigger an ICE, see PR14730. With this patch we just kick that
> out-of-bounds case label out even before gimplifying.
Do all the affected diagnostics already have tests in the testsuite?
What happens for case labels that are outside the range of the original
type but inside the range after conversion to the promoted type (which may
or may not be the same as the original)? Warnings may make sense, but the
labels in such cases still need to be kept.
--
Joseph S. Myers http://www.srcf.ucam.org/~jsm28/gcc/
jsm@polyomino.org.uk (personal mail)
jsm28@gcc.gnu.org (Bugzilla assignments and CCs)