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] Optimize MINUS_EXPR jump (PR middle-end/21237)


On Sun, 8 May 2005, David Edelsohn wrote:
>
> 	PR middle-end/21237
> 	* dojump.c (do_jump, MINUS_EXPR): Build NE_EXPR and fall through
> 	to NE_EXPR case.

This is OK for mainline, after a suitable bootstrap and regression test.

I'd investigated PR middle-end/21237 a bit myself, it appears that
somewhere in the tree-ssa optimizers, between .t66.copyrename3 and
.t67.optimized, we generate the tree "a - b != 0", in function "g"
below without calling fold which would transform it into "a != b".

int g(long long a, long long b)
{
  a -= b;
  return !a;
}

int f(long long a, long long b)
{
  return a == b;
}

int h(long long a, long long b)
{
  return !(a - b);
}

I'd be interested in knowing why/how we're generating unfolded trees
for this test case.  Fixing this in expand is a reasonable solution,
but I think there's a deeper problem that still needs to be investigated.


Roger
--


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