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 2/2] Fix PR47594: Build signed niter expressions


Hi,

> 	* tree-ssa-loop-niter.c (number_of_iterations_ne): Use the signed types
> 	for the trivial case, then convert to unsigned.
> 	(number_of_iterations_lt): Use the original signed types.
> 	(number_of_iterations_cond): Same.
> 	(find_loop_niter): Build signed integer constant.
> 	(loop_niter_by_eval): Same.

this is incorrect, or at least very dubious.  Number of iterations does not have
to fit in the signed variant of the type; and since it is always a nonnegative
number, even semantically using an unsigned type seems to be a better choice.
What is the purpose of this change?

Zdenek


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