OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [cris-volatile-1.c] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* Copyright (C) 2003  Free Software Foundation.
2
   Check that size-optimizations for move insns (specifically peephole
3
   optimizations) aren't applied to volatile objects in the CRIS port.
4
   Origin: Hans-Peter Nilsson.  */
5
/* { dg-do compile { target cris-*-* crisv32-*-* } } */
6
/* { dg-final { scan-assembler-not {movu\...\[} } } */
7
/* { dg-final { scan-assembler-not {move\.[^d].\[} } } */
8
/* { dg-final { scan-assembler-not {and\.[^d].\[} } } */
9
/* { dg-final { scan-assembler-not {or\.[^d].\[} } } */
10
 
11
static const unsigned long c = 0x0000FF00;
12
unsigned long
13
a1 (void)
14
{
15
  unsigned long m;
16
  m = *(volatile unsigned long*) 0xb00000c8;
17
  m &= c;
18
  return m;
19
}
20
extern volatile unsigned long xx;
21
unsigned long
22
a2 (void)
23
{
24
  unsigned long m;
25
  m = xx;
26
  m &= c;
27
  return m;
28
}
29
extern volatile unsigned long yy[];
30
unsigned long
31
a3 (void)
32
{
33
  unsigned long m;
34
  m = yy[3];
35
  m &= 0xfe00;
36
  return m;
37
}
38
unsigned long
39
ac1 (void)
40
{
41
  unsigned long m;
42
  m = *(volatile unsigned long*) 0xb00000c8;
43
  m &= 0xfe00;
44
  return m;
45
}
46
extern volatile unsigned long xx;
47
unsigned long
48
ac2 (void)
49
{
50
  unsigned long m;
51
  m = xx;
52
  m &= 0xfe00;
53
  return m;
54
}
55
extern volatile unsigned long yy[];
56
unsigned long
57
ac3 (void)
58
{
59
  unsigned long m;
60
  m = yy[3];
61
  m &= 0xfe00;
62
  return m;
63
}
64
extern volatile unsigned long yy[];
65
unsigned long
66
oc3 (void)
67
{
68
  unsigned long m;
69
  m = yy[3];
70
  m |= ~0xf;
71
  return m;
72
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.