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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [pr20017.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
/* PR rtl-optimization/20017
2
 
3
   After CSE/GCSE folds a switch statement to an unconditional jump,
4
   cfg_cleanup did not remove a dead jump table, confusing the CFG
5
   layout code later on.  */
6
 
7
/* { dg-do compile } */
8
/* { dg-options "-O1" } */
9
/* { dg-options "-O1 -march=i386" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
10
 
11
int
12
foo (int *buf, int *p)
13
{
14
  int result;
15
  const int *tmp;
16
 
17
  if (*buf)
18
    return 1;
19
 
20
  result = 2;
21
  *buf = 2;
22
  tmp = buf;
23
  switch (*tmp)
24
    {
25
    case 3:
26
    case 4:
27
    case 6:
28
    case 14:
29
      return 1;
30
 
31
    case 0:
32
      result = *p;
33
 
34
      /* Fall through.  */
35
    default:
36
      if (result)
37
        return 1;
38
    }
39
 
40
  return 0;
41
}

powered by: WebSVN 2.1.0

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