This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Finish off PR15784
- From: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- To: Eric Botcazou <ebotcazou at libertysurf dot fr>
- Cc: Andrew Pinski <pinskia at physics dot uc dot edu>, gcc-patches at gcc dot gnu dot org,law at redhat dot com, Ranjit Mathew <rmathew at gmail dot com>
- Date: Sat, 5 Mar 2005 10:29:53 +0100
- Subject: Re: [PATCH] Finish off PR15784
- References: <200503050037.05795.ebotcazou@libertysurf.fr>
Hello,
> > Basically something like the following is going on. I cannot remember
> > the exact numbers.
> > We get 255UC - 1UC which we fold to ~1UC but since
> > folding of <BIT_NOT_EXPR 1UC> sets the TREE_OVERFLOW bit, host_integerp
> > returns false.
>
> The patch broke Ada on i586 with something even weirder: 255 - 0 = -1!!?
the reason is that the code to handle switch expansion produces
expressions in a wrong type. In this case, it takes two unsigned char
values, but the MINUS_EXPR is produced in type ``integer''. The expression
then matches prequisities of the patch and folds this to ~0, but
computed in ``integer'', i.e., with value 0.
Zdenek