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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [pr33848.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* &&foo should be hoisted, but on most targets, excess register pressure
2
   forces it to be rematerialized before "data != &&foo".  On targets that
3
   have a "branch if registers are equal" instruction, this leads to the
4
   branch having two LABEL_REFs: one for the branch target and one for
5
   &&foo.  When reloading &&foo into a register, reload would wrongly
6
   say that &&foo was the target of the branch, and the real target would
7
   then be removed as dead.  */
8
/* { dg-do link } */
9
#define NVARS 30
10
#define MULTI(X) \
11
  X( 0), X( 1), X( 2), X( 3), X( 4), X( 5), X( 6), X( 7), X( 8), X( 9), \
12
  X(10), X(11), X(12), X(13), X(14), X(15), X(16), X(17), X(18), X(19), \
13
  X(20), X(21), X(22), X(23), X(24), X(25), X(26), X(27), X(28), X(29)
14
 
15
#define DECLARE(INDEX) i##INDEX = gv[INDEX]
16
#define COPY(INDEX) gv[INDEX] = i##INDEX
17
 
18
volatile int gv[NVARS];
19
void *volatile data;
20
 
21
int
22
main (void)
23
{
24
  __label__ foo;
25
 
26
  if (gv[0] == 1)
27
    goto foo;
28
  data = &&foo;
29
  do
30
    {
31
      int MULTI (DECLARE);
32
      MULTI (COPY);
33
      MULTI (COPY);
34
      MULTI (COPY);
35
      if (data != &&foo)
36
        gv[0] = 1;
37
      else
38
        gv[1] = 2;
39
    }
40
  while (gv[0] > 0);
41
 foo:
42
  return 0;
43
}

powered by: WebSVN 2.1.0

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