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: [tree-ssa] tree-ssa-dom.c: Fix PR 14303.


In message <20040306.092817.48805207.kazu@cs.umass.edu>, Kazu Hirata writes:
 >Hi,
 >
 >Attached is a patch to fix PR optimization/14303.
 >
 >Consider:
 >
 >void
 >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:
 >
 >foo (x)
 >{
 >  double q;
 >  double p;
 >
 ><bb 0>:
 >  p_2 = ABS_EXPR <x_1>;
 >  q_3 = 0.0;
 >  return;
 >
 >}
 >
 >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?
 >
 >Kazu Hirata
 >
 >2004-03-05  Kazu Hirata  <kazu@cs.umass.edu>
 >
 >	* 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:

http://std.dkuug.dk/JTC1/SC22/WG14/www/docs/n819.htm

jeffk


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