This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Fix PR26859
Sebastian Pop wrote:
> Roger Sayle wrote:
> >
> > You seem to be using a mixture of build_int_cst and build_int_cst_type.
> > The difference is that the second one performs extra work to correctly
> > set the high order bits of a constant based upon the type. So for the
> > constant one, it's better to consistently use build_int_cst (type, 1)
> > instead of build_int_cst_type (type, 1).
> >
>
> I will test a patch to fix this.
>
Here is the patch that fixes these typos. Bootstrapped and tested on
amd64-linux. Committed to trunk.
2006-04-04 Sebastian Pop <pop@cri.ensmp.fr>
* tree-scalar-evolution.c (compute_overall_effect_of_inner_loop,
set_nb_iterations_in_loop): Use build_int_cst instead of
build_int_cst_type.
* tree-data-ref.c (can_use_analyze_subscript_affine_affine): Use
build_int_cst instead of convert.
Index: tree-scalar-evolution.c
===================================================================
--- tree-scalar-evolution.c (revision 112662)
+++ tree-scalar-evolution.c (working copy)
@@ -481,7 +481,7 @@ compute_overall_effect_of_inner_loop (st
/* Number of iterations is off by one (the ssa name we
analyze must be defined before the exit). */
nb_iter = chrec_fold_minus (type, nb_iter,
- build_int_cst_type (type, 1));
+ build_int_cst (type, 1));
/* evolution_fn is the evolution function in LOOP. Get
its value in the nb_iter-th iteration. */
@@ -897,7 +897,7 @@ set_nb_iterations_in_loop (struct loop *
{
tree type = chrec_type (res);
- res = chrec_fold_plus (type, res, build_int_cst_type (type, 1));
+ res = chrec_fold_plus (type, res, build_int_cst (type, 1));
/* FIXME HWI: However we want to store one iteration less than the
count of the loop in order to be compatible with the other
Index: tree-data-ref.c
===================================================================
--- tree-data-ref.c (revision 112662)
+++ tree-data-ref.c (working copy)
@@ -3057,7 +3057,7 @@ can_use_analyze_subscript_affine_affine
diff, CHREC_RIGHT (*chrec_a));
right_b = chrec_convert (type, CHREC_RIGHT (*chrec_b), NULL_TREE);
*chrec_b = build_polynomial_chrec (CHREC_VARIABLE (*chrec_b),
- convert (type, integer_zero_node),
+ build_int_cst (type, 0),
right_b);
return true;
}