Add -fdelete-null-pointer-checks to more new C++ testcases.
[gcc.git] / gcc / testsuite / g++.dg / recip_sqrt_mult_2.C
1 /* { dg-do compile } */
2 /* { dg-options "-w -Ofast -fnon-call-exceptions -ftrapping-math -fdump-tree-recip" } */
3
4 /* Check that the recip_sqrt optimization does not trigger here, causing an
5 ICE due to EH info. */
6
7
8 double res, res2, tmp;
9 void
10 foo1 (double a, double b)
11 {
12 try {
13 tmp = 1.0 / __builtin_sqrt (a);
14 res = tmp * tmp;
15 res2 = a * tmp;
16 }
17 catch (...)
18 { ; }
19 }
20
21 void
22 foo4 (double a, double b, int c, int d)
23 {
24 try {
25 tmp = 1.0 / __builtin_sqrt (a);
26 }
27 catch (...)
28 {
29 if (c)
30 res = tmp * tmp;
31
32 if (d)
33 res2 = a * tmp;
34 }
35 }
36
37 void
38 foo5 (double a, double b, int c, int d)
39 {
40 try {
41 tmp = 1.0 / __builtin_sqrt (a);
42 res = tmp * tmp;
43
44 if (d)
45 res2 = a * tmp;
46 }
47 catch (...)
48 { ; }
49 }