From: Jakub Jelinek Date: Tue, 11 Jun 2019 16:43:09 +0000 (+0200) Subject: re PR target/90811 ([nvptx] ptxas error on OpenMP offloaded code) X-Git-Tag: releases/gcc-9.2.0~255 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb0e2d2799a9be0ef447df2abd788a40fdde6d3a;p=thirdparty%2Fgcc.git re PR target/90811 ([nvptx] ptxas error on OpenMP offloaded code) PR target/90811 * config/nvptx/nvptx.c (nvptx_output_softstack_switch): Use and.b%d instead of and.u%d. * testsuite/libgomp.c/pr90811.c: New test. From-SVN: r272162 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7cb4ee01d7e6..bf9a5113f65e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-06-11 Jakub Jelinek + + PR target/90811 + * config/nvptx/nvptx.c (nvptx_output_softstack_switch): Use and.b%d + instead of and.u%d. + 2019-06-07 John David Anglin PR target/90751 diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c index a28099ac89dd..1986e79309ac 100644 --- a/gcc/config/nvptx/nvptx.c +++ b/gcc/config/nvptx/nvptx.c @@ -1475,7 +1475,7 @@ nvptx_output_softstack_switch (FILE *file, bool entering, fputs (";\n", file); if (!CONST_INT_P (size) || UINTVAL (align) > GET_MODE_SIZE (DImode)) fprintf (file, - "\t\tand.u%d %%r%d, %%r%d, -" HOST_WIDE_INT_PRINT_DEC ";\n", + "\t\tand.b%d %%r%d, %%r%d, -" HOST_WIDE_INT_PRINT_DEC ";\n", bits, regno, regno, UINTVAL (align)); } if (cfun->machine->has_softstack) diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 8f54fa47eb2f..cd36942b4615 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2019-06-11 Jakub Jelinek + + PR target/90811 + * testsuite/libgomp.c/pr90811.c: New test. + 2019-06-05 Jakub Jelinek Backported from mainline diff --git a/libgomp/testsuite/libgomp.c/pr90811.c b/libgomp/testsuite/libgomp.c/pr90811.c new file mode 100644 index 000000000000..25b7d78c0eac --- /dev/null +++ b/libgomp/testsuite/libgomp.c/pr90811.c @@ -0,0 +1,29 @@ +/* PR target/90811 */ + +int +main () +{ + long long a[100], b[100]; + int i; + for (i = 0; i < 100; i++) + { + a[i] = i; + b[i] = i % 10; + } + #pragma omp target teams distribute parallel for simd map(tofrom: a[:100], b[:100]) + for (i = 0; i < 100; i++) + { + long long c = 0; + const long long d[] = { 1, 3, 5, 7, 9 }; + for (int j = 4; j >= 0; j--) + c = d[j] + b[i] * c; + a[i] += c; + } + for (i = 0; i < 100; i++) + { + const long long r[] = { 1, 26, 229, 976, 2849, 6646, 13381, 24284, 40801, 64594 }; + if (a[i] != r[i % 10] + (i / 10 * 10)) + __builtin_abort (); + } + return 0; +}