PR tree-optimization/19903

Sebastian Pop sebastian.pop@cri.ensmp.fr
Wed Mar 30 13:42:00 GMT 2005


Zdenek Dvorak wrote:
> 
> it is clear how they should behave.  The restriction relevant to the
> problem iss that we want checs to satisfy
> 
> TREE_TYPE (chrec) == TREE_TYPE (CHREC_LEFT (chrec)) == TREE_TYPE (CHREC_RIGHT (chrec)).
> 
> I would strongly oppose changing this; 

Okay, I won't oppose.  However, the above rule should be in the
comments of chrec_convert together with an example illustrating why
this should be satisfied.

An example that comes to mind is: 

{(uint) 0, +, (uchar) 10} +
{(uint) 0, +, (uchar) 250}

that would produce a wrong result if CHREC_RIGHT is not (uint):

{(uint) 0, +, (uchar) 4} 

Note that this could be dealt with in the chrec_plus function, such
that it applies the conversion on the CHREC_RIGHT part.

> Other possibility is to give up for types such that range of the
> type is different from 1 << TYPE_PRECISION (type).

It seems to me that failing in chrec_convert and returning a
chrec_dont_know is the best solution.

Sebastian



More information about the Gcc-patches mailing list