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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [alias-20.c] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O -fstrict-aliasing -fdump-tree-optimized" } */
3
 
4
struct S { float f; int i; };
5
struct R { int x; int i; };
6
 
7
/* Strict-aliasing rules say that int and float do not alias.  */
8
int bar(struct S *s, int *i)
9
{
10
  *i = 0;
11
  s->f = 1.0;
12
  return *i;
13
}
14
 
15
/* Strict-aliasing rules say that S and R do not alias.  */
16
int foo(struct S *s, struct R *r)
17
{
18
  r->i = 0;
19
  s->i = 1;
20
  return r->i;
21
}
22
 
23
/* { dg-final { scan-tree-dump-times "return 0;" 2 "optimized" } } */
24
/* { dg-final { cleanup-tree-dump "optimized" } } */

powered by: WebSVN 2.1.0

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