This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] for PR 27144
- From: Sebastian Pop <sebastian dot pop at cri dot ensmp dot fr>
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: Roger Sayle <roger at eyesopen dot com>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 2 May 2006 19:41:27 +0200
- Subject: Re: [patch] for PR 27144
- References: <20060428084241.GA31713@atrey.karlin.mff.cuni.cz> <Pine.LNX.4.44.0604280828150.19926-100000@www.eyesopen.com> <20060501193634.GA32095@atrey.karlin.mff.cuni.cz>
Zdenek Dvorak wrote:
> >
> > Do you have any figures on what the change to fix PR 23434 has cost us
> > in terms of performance?
>
> no. Sebastian, did you do any measurements before commiting that patch?
>
no. I'm counting how many cases we now are missing with because of
that patch... I just began a bootstrap with an older version of trunk
and the attached patch. For the moment I'm at more than a thousand
missed cases of the form:
(unsigned intD.3) D.30156_23
jD.31044_544 > 2 ? 0 : 2 - jD.31044_544
numD.29685_5
etc.
Index: tree-ssa-loop-niter.c
===================================================================
--- tree-ssa-loop-niter.c (revision 113071)
+++ tree-ssa-loop-niter.c (working copy)
@@ -1760,6 +1760,7 @@ proved_non_wrapping_p (tree at_stmt,
tree new_type,
tree valid_niter)
{
+ bool noncst = false;
tree cond;
tree bound = niter_bound->bound;
enum tree_code cmp;
@@ -1771,7 +1772,7 @@ proved_non_wrapping_p (tree at_stmt,
/* Give up if BOUND was not folded to an INTEGER_CST, as in PR23434. */
if (TREE_CODE (bound) != INTEGER_CST)
- return false;
+ noncst = true;
/* After the statement niter_bound->at_stmt we know that anything is
executed at most BOUND times. */
@@ -1784,7 +1785,14 @@ proved_non_wrapping_p (tree at_stmt,
cond = fold_binary (cmp, boolean_type_node, valid_niter, bound);
if (nonzero_p (cond))
- return true;
+ {
+ if (noncst)
+ {
+ fprintf (stderr, "missedOne\n");
+ debug_generic_expr (bound);
+ }
+ return true;
+ }
cond = build2 (cmp, boolean_type_node, valid_niter, bound);
/* Try taking additional conditions into account. */
@@ -1793,7 +1801,14 @@ proved_non_wrapping_p (tree at_stmt,
cond);
if (nonzero_p (cond))
- return true;
+ {
+ if (noncst)
+ {
+ fprintf (stderr, "missedOne\n");
+ debug_generic_expr (bound);
+ }
+ return true;
+ }
return false;
}