https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116683

--- Comment #5 from Alex Coplan <acoplan at gcc dot gnu.org> ---
Ah, so the problem seems to be that we're scanning for "Unrolled loop 3 times"
appearing exactly once in the dump, but on powerpc it appears twice; that is
because the loop in main gets unrolled too (presumably due to different
unrolling heuristics on power).

The following, therefore, seems to fix the test failures on powerpc:

diff --git a/gcc/testsuite/g++.dg/ext/pragma-unroll-lambda-lto.C
b/gcc/testsuite/g++.dg/ext/pragma-unroll-lambda-lto.C
index 64cdf90f34d..20cbd2d15cf 100644
--- a/gcc/testsuite/g++.dg/ext/pragma-unroll-lambda-lto.C
+++ b/gcc/testsuite/g++.dg/ext/pragma-unroll-lambda-lto.C
@@ -24,6 +24,7 @@ short *use_find(short *p)
 int main(void)
 {
   short a[1024];
+#pragma GCC unroll 0
   for (int i = 0; i < 1024; i++)
     a[i] = rand ();

I'll submit that fix if it still passes on aarch64 with that change too.

Reply via email to