gcc/testsuite/g++.dg/opt/pr58006.C
raw| 1 | // PR tree-optimization/58006 |
| 2 | // { dg-do compile } |
| 3 | // { dg-require-effective-target pthread } |
| 4 | // { dg-options "-Ofast -ftree-parallelize-loops=2" } |
| 5 | |
| 6 | extern "C" float sqrtf (float); |
| 7 | |
| 8 | struct S |
| 9 | { |
| 10 | float i, j; |
| 11 | float foo () const { return sqrtf (i * i + j * j); } |
| 12 | S () : i (1), j (1) {} |
| 13 | }; |
| 14 | |
| 15 | void |
| 16 | bar (int a, int b) |
| 17 | { |
| 18 | int i; |
| 19 | float f; |
| 20 | for (i = a; i < b; i++) |
| 21 | f = S ().foo (); |
| 22 | } |