summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/sparc-trap-1.c
blob: a516a8864953ba33acb76ae9df73b069142d5393 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* PR target/15693 */
/* { dg-do compile { target sparc*-*-* } } */
/* { dg-options "-O2" } */

/* This used to fail on SPARC at -O2 because the combiner
   produces a compare insn that was not rematched by the
   compare expander.  */

static __inline__ __attribute__ ((always_inline))
int page_mapping (unsigned flags)
{
  if (1u & (flags >> 16))
    return 1;
  return 0;
}
void install_page (unsigned flags)
{
  if (__builtin_expect (!page_mapping (flags), 0))
    __builtin_trap ();
}