Hi,

atm, for nvptx we have the following failure:
...
FAIL: gcc.dg/stdint-width-1.c (test for excess errors)
...

In more detail:
...
gcc/testsuite/gcc.dg/stdint-width-1.c:20:4: error: #error "missing INT8_WIDTH"
...

The test fails because newlib's stdint.h lacks TS 18661-1 support.

The test deliberately uses -ffreestanding so that any
configurations using GCC's stdint.h for freestanding compilations have no problems with system stdint.h lacking TS 18661-1 support. But GCC stdint.h is not used for nvptx, because use_gcc_stdint defaults to "none" in config.gcc.

The patch fixes the test failure by setting use_gcc_stdint=wrap for nvptx, so that GCC's stdint.h includes libc's for hosted compilations but GCC's own for freestanding compilations.

Build and reg-tested on nvptx.
Build on x86_64 with nvptx accelerator and tested libgomp.

Committed.

Thanks,
- Tom

Set use_gcc_stdint=wrap for nvptx

2018-01-12  Tom de Vries  <t...@codesourcery.com>

	PR target/83737
	* config.gcc (nvptx*-*-*): Set use_gcc_stdint=wrap.

---
 gcc/config.gcc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/config.gcc b/gcc/config.gcc
index 4ef52ce..122d44e 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -2353,6 +2353,7 @@ nios2-*-*)
 	;;
 nvptx-*)
 	tm_file="${tm_file} newlib-stdint.h"
+	use_gcc_stdint=wrap
 	tmake_file="nvptx/t-nvptx"
 	if test x$enable_as_accelerator = xyes; then
 		extra_programs="${extra_programs} mkoffload\$(exeext)"

Reply via email to