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/] [20040319-1.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O2" } */
3
 
4
/* Test derived from PR 14643.  When a function has no addressable
5
   variables but 2 or more pointers have conflicting memory tags, they
6
   were not being processed by the type based alias analyzer,
7
   resulting in optimizations removing a non-redundant load.  */
8
 
9
extern void abort (void);
10
 
11
struct bar { int count;  int *arr;};
12
 
13
void foo (struct bar *b)
14
{
15
  b->count = 0;
16
  *(b->arr) = 2;
17
  if (b->count == 0)     /* b->count can't be assumed to be 0 here.  */
18
    abort ();
19
}
20
 
21
main ()
22
{
23
  struct bar x;
24
  x.arr = &x.count;
25
  foo (&x);
26
  return 0;
27
}

powered by: WebSVN 2.1.0

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