[committed,PR83737] Set use_gcc_stdint=wrap for nvptx

Message ID c6da1727-9a86-9ded-c06d-4d139fa3c223@mentor.com
State New
Headers show
  • [committed,PR83737] Set use_gcc_stdint=wrap for nvptx
Related show

Commit Message

Tom de Vries Jan. 12, 2018, 5:46 p.m.

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 

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.


- Tom


Set use_gcc_stdint=wrap for nvptx

2018-01-12  Tom de Vries  <tom@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-*-*)
 	tm_file="${tm_file} newlib-stdint.h"
+	use_gcc_stdint=wrap
 	if test x$enable_as_accelerator = xyes; then
 		extra_programs="${extra_programs} mkoffload\$(exeext)"