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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [tree-ssa/] [copyprop-1.C] - Blame information for rev 199

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

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O -fdump-tree-dce2" } */
3
 
4
/* Verify that we can eliminate the useless conversions to/from
5
   const qualified pointer types
6
     this_2 = o_1;
7
     D.20003_4 = this_2->data_m;
8
     this_5 = D.20003_4;
9
     D.20005_6 = this_5->value;
10
   copyprop should propagate o_1 and D.20003_4 to the loads of data_m
11
   and value.  dce removes all traces of this.  */
12
 
13
struct Data {
14
  int get() const { return value; }
15
  int value;
16
};
17
 
18
struct Object {
19
  int operator[](int i) const { return data_m->get(); }
20
  Data *data_m;
21
};
22
 
23
int foo(Object&o)
24
{
25
  return o[0];
26
}
27
 
28
/* { dg-final { scan-tree-dump-not ".* = \[^>;\]*;" "dce2" { xfail *-*-* } } } */
29
/* { dg-final { cleanup-tree-dump "dce2" } } */

powered by: WebSVN 2.1.0

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