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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20020213-1.c] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
/* PR c/5681
2
   This testcase failed on IA-32 at -O0, because safe_from_p
3
   incorrectly assumed it is safe to first write into a.a2 b-1
4
   and then read the original value from it.  */
5
 
6
int bar (float);
7
 
8
struct A {
9
  float a1;
10
  int a2;
11
} a;
12
 
13
int b;
14
 
15
void foo (void)
16
{
17
  a.a2 = bar (a.a1);
18
  a.a2 = a.a2 < b - 1 ? a.a2 : b - 1;
19
  if (a.a2 >= b - 1)
20
    abort ();
21
}
22
 
23
int bar (float x)
24
{
25
  return 2241;
26
}
27
 
28
int main()
29
{
30
  a.a1 = 1.0f;
31
  b = 3384;
32
  foo ();
33
  return 0;
34
}

powered by: WebSVN 2.1.0

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