2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / recip_sqrt_mult_2.C
blobcca12caf4d79bfa69933d9b8fce41f38bb5b7a19
1 /* { dg-do compile } */
2 /* { dg-options "-w -Ofast -fnon-call-exceptions -ftrapping-math -fdump-tree-recip" } */
4 /* Check that the recip_sqrt optimization does not trigger here, causing an
5    ICE due to EH info.  */
8 double res, res2, tmp;
9 void
10 foo1 (double a, double b)
12   try {
13     tmp = 1.0 / __builtin_sqrt (a);
14     res = tmp * tmp;
15     res2 = a * tmp;
16   }
17   catch (...)
18     { ; }
21 void
22 foo4 (double a, double b, int c, int d)
24   try {
25     tmp = 1.0 / __builtin_sqrt (a);
26   }
27   catch (...)
28     {
29       if (c)
30         res = tmp * tmp;
32       if (d)
33         res2 = a * tmp;
34     }
37 void
38 foo5 (double a, double b, int c, int d)
40   try {
41     tmp = 1.0 / __builtin_sqrt (a);
42     res = tmp * tmp;
44     if (d)
45       res2 = a * tmp;
46   }
47   catch (...)
48     { ; }