sourcebuild.texi: Document check_effective_target_newlib_nano_io.

2018-11-26  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	gcc/ChangeLog:

	* doc/sourcebuild.texi: Document check_effective_target_newlib_nano_io.

	gcc/testsuite/ChangeLog:

	* lib/target-supports.exp (check_effective_target_newlib_nano_io): New. 
	* gcc.c-torture/execute/920501-8.c: Register undefined linker symbol
	_printf_float for newlib_nano_io target.
	* gcc.c-torture/execute/930513-1.c: Likewise.
	* gcc.dg/torture/builtin-sprintf.c: Likewise.
	* gcc.c-torture/execute/ieee/920810-1.x: New.

From-SVN: r266488
This commit is contained in:
Jozef Lawrynowicz 2018-11-26 21:35:43 +00:00 committed by Jozef Lawrynowicz
parent 8b1f4e1f8a
commit 571bbd0d48
8 changed files with 32 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2018-11-26 Jozef Lawrynowicz <jozef.l@mittosystems.com>
* doc/sourcebuild.texi: Document check_effective_target_newlib_nano_io.
2018-11-26 Jakub Jelinek <jakub@redhat.com>
PR target/88195

View File

@ -2152,6 +2152,10 @@ Target supports @code{mmap}.
@item newlib
Target supports Newlib.
@item newlib_nano_io
GCC was configured with @code{--enable-newlib-nano-formatted-io}, which reduces
the code size of Newlib formatted I/O functions.
@item pow10
Target provides @code{pow10} function.

View File

@ -1,3 +1,12 @@
2018-11-26 Jozef Lawrynowicz <jozef.l@mittosystems.com>
* lib/target-supports.exp (check_effective_target_newlib_nano_io): New.
* gcc.c-torture/execute/920501-8.c: Register undefined linker symbol
_printf_float for newlib_nano_io target.
* gcc.c-torture/execute/930513-1.c: Likewise.
* gcc.dg/torture/builtin-sprintf.c: Likewise.
* gcc.c-torture/execute/ieee/920810-1.x: New.
2018-11-26 Jakub Jelinek <jakub@redhat.com>
PR target/88195

View File

@ -1,3 +1,5 @@
/* { dg-additional-options "-Wl,-u,_printf_float" { target newlib_nano_io } } */
#include <stdio.h>
#include <stdarg.h>

View File

@ -1,3 +1,5 @@
/* { dg-additional-options "-Wl,-u,_printf_float" { target newlib_nano_io } } */
#include <stdio.h>
char buf[2];

View File

@ -0,0 +1,4 @@
if { [check_effective_target_newlib_nano_io] } {
lappend additional_flags "-Wl,-u,_printf_float"
}
return 0

View File

@ -1,6 +1,7 @@
/* PR tree-optimization/86274 - SEGFAULT when logging std::to_string(NAN)
{ dg-do run }
{ dg-options "-O2 -Wall" } */
{ dg-options "-O2 -Wall" }
{ dg-additional-options "-Wl,-u,_printf_float" { target newlib_nano_io } } */
#define X "0xdeadbeef"
#define nan(x) __builtin_nan (x)

View File

@ -6710,6 +6710,11 @@ proc check_effective_target_newlib {} {
}]
}
# Return true if GCC was configured with --enable-newlib-nano-formatted-io
proc check_effective_target_newlib_nano_io { } {
return [check_configured_with "--enable-newlib-nano-formatted-io"]
}
# Some newlib versions don't provide a frexpl and instead depend
# on frexp to implement long double conversions in their printf-like
# functions. This leads to broken results. Detect such versions here.