On Sun, Sep 21, 2008 at 8:34 PM, Mark Mitchell <[EMAIL PROTECTED]> wrote:
> Steven Bosscher wrote:
>
>> +  if (signed_char)
>> +    {
>> +      char_type_node = make_signed_type (CHAR_TYPE_SISE);
>> +      TYPE_CANONICAL (char_type_node) = signed_char_type_node;
>> +    }
>
> I don't think this is a good idea.  TYPE_CANONICAL is used for
> type-comparison at the language level, and "char" and "signed char" are
> different types -- even when "char" is signed.
>
> For example:
>
>   char* q;
>   signed char *p = q;
>
> is not valid without a cast.

char and signed char (if char is signed) are the same types for the
middle-end (but not for the Frontend).  To "fix" this we basically
need to "gimplify" types - but this is obviously only possible if the
Frontend is truly finished.  Another thing to consider is debug
information which is why I still advocate outputting debug information
for types and decls early (which basically means from the frontends).

Prerequesites for all this is of course that we gimplify unit-at-a-time so
the frontend is finished processing the TU and we can safely munge
its types and decls to whatever we like for the middle-end or LTO
(I believe the LTO branch already does this, so just fixup the char
types there).

Richard.

Reply via email to