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: [PATCH] Finish off PR15784


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


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