This is the mail archive of the
mailing list for the GCC project.
Re: [tree-ssa] tree-ssa-dom.c: Fix PR 14303.
- From: law at redhat dot com
- To: Kazu Hirata <kazu at cs dot umass dot edu>
- Cc: gcc-patches at gcc dot gnu dot org, roger at eyesopen dot com, pinskia at physics dot uc dot edu
- Date: Sun, 07 Mar 2004 19:15:00 -0700
- Subject: Re: [tree-ssa] tree-ssa-dom.c: Fix PR 14303.
- Reply-to: law at redhat dot com
In message <email@example.com>, Kazu Hirata writes:
>Attached is a patch to fix PR optimization/14303.
>foo (double x)
> double p, q;
> p = fabs (x);
> q = 0.0;
> if (p < q)
> link_error ();
>Without the patch, the tree-ssa cannot fold p < q. With the patch,
>dom1 gives me:
> double q;
> double p;
> p_2 = ABS_EXPR <x_1>;
> q_3 = 0.0;
>I put this optimization in simplify_cond_and_lookup_avail_expr, but
>I'm not sure if this is the right place as the only machinery I need
>is SSA_NAME_DEF_STMT. I thought I should do this in fold, but
>applying Steven's patch in PR 14303 didn't work.
>Tested on i686-pc-linux-gnu. OK to apply?
>2004-03-05 Kazu Hirata <firstname.lastname@example.org>
> * tree-ssa-dom.c (simplify_cond_and_lookup_avail_expr): Fold
> abs (x) < 0.0 into false.
Based in the comments in the PR, I do not think this is correct due to
not properly handling NaNs.
The PR references the following: