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]

Re: fix for LT comparison


> Date: Mon, 17 Jul 2000 01:00:38 -0600
> From: Jeffrey A Law <law@cygnus.com>

>   > 2000-07-08  Geoffrey Keating  <geoffk@cygnus.com>
>   > 
>   > 	* simplify-rtx.c (simplify_relational_operation): Two signed
>   > 	values with equal high words are less/greater than each other if
>   > 	their low words are less/greater when considered as unsigned.
> This is fine.  Please install this patch.
> 
> Did you happen to have a testcase for this patch that could be included
> in the testsuite?  If so, could you please make one?

OK, I'll add the following as 20000717-2.c:

static void
compare (long long foo)
{
  if (foo < 4294967297LL)
    abort();
}
int main(void)
{
  compare (8589934591LL);
  exit (0);
}

It fails with -O3 on a gcc without the patch and works with it.

-- 
- Geoffrey Keating <geoffk@cygnus.com>

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