1 /* { dg-do compile } */ 2 /* { dg-options "-O2 -fdump-ipa-icf" } */ 3 4 #include <stdio.h> 5 6 struct container 7 { 8 int x; 9 int y; 10 }; 11 12 static struct container max; 13 static int pole[3][3]; 14 static int pole2[123]; 15 16 static struct container superpole[10][10]; 17 f1(struct container * c)18void f1(struct container *c) 19 { 20 struct container pes; 21 pes.x = 123; 22 pes.y = 123; 23 24 struct container *pesp = c; 25 pesp->x = 5; 26 27 pole[1][2] = 3; 28 29 superpole[4][3].x = 4; 30 max.x = 3; 31 void *x = &pole; 32 33 int **a = (int**)pole; 34 a[1][2] = 543; 35 36 if(x != 0) 37 pole[1][2] = 123; 38 } 39 f2(struct container * c)40void f2(struct container *c) 41 { 42 struct container pes; 43 pes.x = 123; 44 pes.y = 123; 45 46 struct container *pesp = c; 47 pesp->x = 5; 48 49 pole[1][2] = 3; 50 51 superpole[4][3].x = 4; 52 max.x = 3; 53 void *x = &pole; 54 55 int **a = (int**)pole; 56 a[1][2] = 543; 57 58 if(x != 0) 59 pole[1][2] = 123; 60 } 61 main(int argc,char ** argv)62int main(int argc, char **argv) 63 { 64 return 0; 65 } 66 67 /* { dg-final { scan-ipa-dump "Semantic equality hit:f1->f2" "icf" } } */ 68 /* { dg-final { scan-ipa-dump "Equal symbols: 1" "icf" } } */ 69