This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] gimp vs expand_end_case_type
- From: law at redhat dot com
- To: Jason Merrill <jason at redhat dot com>
- Cc: Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 03 Sep 2003 14:30:47 -0600
- Subject: Re: [tree-ssa] gimp vs expand_end_case_type
- Reply-to: law at redhat dot com
In message <wvly8x5wwyq.fsf@prospero.boston.redhat.com>, Jason Merrill writes:
>On Wed, 3 Sep 2003 00:54:14 -0700, Richard Henderson <rth@redhat.com> wrote:
>
>> The problem is, the cast here isn't completely unnecessary.
>> The exact type of the expression Means Things to the code that
>> expands switch statements.
>> Arguably, this is wrong, and we should store this type somewhere else.
>
>I would argue that the problem is the C frontend giving an incorrect value
>for TYPE_MAX_VALUE of enums. The C++ frontend uses the actual range of
>values an object of the type can have; your testcase demonstrates why the C
>practice of only describing the range of named enums is wrong.
In fact, the C front-end's practice of only describing the range of the named
enums has caused problems in the past.
revision 1.52
date: 1999/02/16 00:41:58; author: law; state: Exp; lines: +6 -0
* c-common.c (shorten_compare): Get the min/max value from the
underlying type of an enumeration, not the enumerated type itself.
jeff