This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Move out-of-bound case labels warning to the C front end


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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]