1 /* PR tree-optimization/52448 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -ftree-cselim -fdump-tree-cselim-details" } */
4
5 extern void perhaps_free_something (void);
6
f1(int * p,int a,int b,int cond,int cond2)7 void f1 (int *p, int a, int b, int cond, int cond2)
8 {
9 *p = a;
10 if (cond)
11 perhaps_free_something ();
12 if (cond2)
13 *p = b;
14 }
15
f2(int * p,int a,int b,int * cond,int * cond2)16 void f2 (int *p, int a, int b, int *cond, int *cond2)
17 {
18 int i;
19 *p = a;
20 for (i = 0; cond[i]; i++)
21 {
22 if (cond2[i])
23 *p = b;
24 perhaps_free_something ();
25 }
26 }
27
28 /* None of the above conditional stores might be made unconditional. */
29 /* { dg-final { scan-tree-dump-not "cstore" "cselim" } } */
30