This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 2/2] Fix PR47594: Build signed niter expressions
- From: Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>
- To: Sebastian Pop <sebpop at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, rguenther at suse dot de
- Date: Tue, 2 Aug 2011 09:48:07 +0200
- Subject: Re: [PATCH 2/2] Fix PR47594: Build signed niter expressions
- References: <1312261287-13124-3-git-send-email-sebpop@gmail.com>
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