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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [pr24287.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O2 -fdump-tree-optimized" } */
3
int g1(int);
4
int h(int *a, int *b)__attribute__((pure));
5
void link_error();
6
 
7
/* The calls to link_error should be eliminated, since nothing escapes to
8
   non-pure functions.  */
9
int g(void)
10
{
11
  int t = 0, t1 = 2;
12
  /* ???  That's not true.  The pointers escape to the integer return
13
     value which we do not track in PTA.  */
14
  int t2 = h(&t, &t1);
15
  if (t != 0)
16
    link_error ();
17
  if (t1 != 2)
18
    link_error ();
19
  /* ???  And it would finally escape here even if we did.  */
20
  g1(t2);
21
  if (t != 0)
22
    link_error ();
23
  if (t1 != 2)
24
    link_error ();
25
  return t2 == 2;
26
}
27
/* We are allowed to optimize the first two link_error calls.  */
28
/* { dg-final { scan-tree-dump-times "link_error" 2 "optimized" } } */
29
/* { dg-final { cleanup-tree-dump "optimized" } } */

powered by: WebSVN 2.1.0

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