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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [opt/] [pr22167.C] - Blame information for rev 774

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

Line No. Rev Author Line
1 693 jeremybenn
// Derived from PR22167, which failed on some RISC targets.  The call to
2
// foo() has two successors, one normal and one exceptional, and both
3
// successors use &a[0] and x.  Expressions involving &a[0] can be hoisted
4
// before the call but those involving x cannot.
5
// { dg-options "-Os" }
6
// { dg-do run }
7
 
8
int a[4];
9
 
10
struct S {
11
  S() : x (0) {}
12
  ~S() { a[0] = x; }
13
  int x;
14
};
15
 
16
void
17
foo (int *x)
18
{
19
  if (*x == 1)
20
    throw 1;
21
  *x = 1;
22
}
23
 
24
int
25
main()
26
{
27
  S s;
28
  foo (&s.x);
29
  if (a[0] == s.x)
30
    a[0]++;
31
  return a[0];
32
}

powered by: WebSVN 2.1.0

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