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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [20050719-1.c] - Blame information for rev 823

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

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O2" } */
3
 
4
extern void abort (void) __attribute__ ((__nothrow__)) __attribute__
5
((__noreturn__));
6
extern void exit (int __status) __attribute__ ((__nothrow__))
7
__attribute__ ((__noreturn__));
8
 
9
struct bootLoader {
10
  int x;
11
};
12
 
13
void
14
zap(struct bootLoader *bootLoader)
15
{
16
  /* The expression on the RHS of the assignment is *not* a
17
     dereference of pointer 'bootLoader'.  It is merely used as an
18
     offset calculation.  VRP was erroneously removing the if()
19
     because it thought that 'bootLoader' was always dereferenced.  */
20
  int *boot = &bootLoader->x;
21
 
22
  if (bootLoader)
23
    {
24
      useboot (boot);
25
    }
26
}
27
 
28
int
29
useboot (void *boot)
30
{
31
  abort ();
32
}
33
 
34
main()
35
{
36
  zap (0);
37
  return 0;
38
}

powered by: WebSVN 2.1.0

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