1 /* { dg-do compile } */ 2 /* { dg-options "-O2 -fdump-tree-dse1-details" } */ 3 foo(int * p)4void *foo (int *p) 5 { 6 void *q; 7 /* We should be able to DSE this store (p may point to errno). */ 8 *p = 0; 9 q = __builtin_malloc (4); 10 *p = 0; 11 return q; 12 } 13 14 int j; bar(int * i)15void bar (int *i) 16 { 17 /* This store is dead as well. */ 18 j = 1; 19 *i = 0; 20 j = 2; 21 } 22 23 /* { dg-final { scan-tree-dump-times "Deleted dead store" 2 "dse1" } } */ 24