aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cmp-mem-const-3.c
blob: 5469f10712ea86177bf49830d5b80ef90a9bf98b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { dg-do compile { target { lp64 && { ! { sparc*-*-* hppa*-*-* } } } } } */
/* Excluding sparc since there we do not end up with a comparison of memory and
   a constant which means that the optimization is not applicable.  */
/* { dg-options "-O2 -fdump-rtl-combine-details" } */
/* { dg-final { scan-rtl-dump "narrow comparison from mode .I to HI" "combine" } } */

typedef __UINT64_TYPE__ uint64_t;

int
le_2bytes_a (uint64_t *x)
{
  return *x <= 0x3ffdffffffffffff;
}

int
le_2bytes_b (uint64_t *x)
{
  return *x < 0x3ffe000000000000;
}