[patch] clean some build_int_cst_type

Zdenek Dvorak rakdver@atrey.karlin.mff.cuni.cz
Fri Apr 7 07:48:00 GMT 2006


Hello,

> Index: tree-scalar-evolution.c
> ===================================================================
> --- tree-scalar-evolution.c	(revision 112700)
> +++ tree-scalar-evolution.c	(working copy)
> @@ -875,7 +875,7 @@ add_to_evolution (unsigned loop_nb, tree
>    if (code == MINUS_EXPR)
>      to_add = chrec_fold_multiply (type, to_add, SCALAR_FLOAT_TYPE_P (type)
>  				  ? build_real (type, dconstm1)
> -				  : build_int_cst_type (type, -1));
> +				  : build_int_cst (type, -1));
>  
>    res = add_to_evolution_1 (loop_nb, chrec_before, to_add, at_stmt);
>  
> Index: tree-chrec.c
> ===================================================================
> --- tree-chrec.c	(revision 112699)
> +++ tree-chrec.c	(working copy)
> @@ -125,7 +125,7 @@ chrec_fold_plus_poly_poly (enum tree_cod
>  	   chrec_fold_multiply (type, CHREC_RIGHT (poly1), 
>  				SCALAR_FLOAT_TYPE_P (type)
>  				? build_real (type, dconstm1)
> -				: build_int_cst_type (type, -1)));
> +				: build_int_cst (type, -1)));
>      }
>    
>    if (CHREC_VARIABLE (poly0) > CHREC_VARIABLE (poly1))
> @@ -295,7 +295,7 @@ chrec_fold_plus_1 (enum tree_code code, 
>  	       chrec_fold_multiply (type, CHREC_RIGHT (op1), 
>  				    SCALAR_FLOAT_TYPE_P (type)
>  				    ? build_real (type, dconstm1)
> -				    : build_int_cst_type (type, -1)));
> +				    : build_int_cst (type, -1)));
>  
>  	default:
>  	  {

these three replacements are wrong -- build_int_cst will produce a wrong
constant in case type is unsigned (for these, we want the bits outside
of the precision of the type to be zeros, not ones -- see force_fit_type).

Zdenek



More information about the Gcc-patches mailing list