sourcebuild.texi: Document check_effective_target_newlib_nano_io.
authorJozef Lawrynowicz <jozef.l@mittosystems.com>
Mon, 26 Nov 2018 21:35:43 +0000 (21:35 +0000)
committerJozef Lawrynowicz <jozefl@gcc.gnu.org>
Mon, 26 Nov 2018 21:35:43 +0000 (21:35 +0000)
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

gcc/ChangeLog
gcc/doc/sourcebuild.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/920501-8.c
gcc/testsuite/gcc.c-torture/execute/930513-1.c
gcc/testsuite/gcc.c-torture/execute/ieee/920810-1.x [new file with mode: 0644]
gcc/testsuite/gcc.dg/torture/builtin-sprintf.c
gcc/testsuite/lib/target-supports.exp

index 2d7bcb83f33da89584a45b61ab68dc7ac8a6974b..fd5e8c292a41fb84a37f7e2be23f134edec0ed42 100644 (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
index b8ab0ee629f6486852b0ffbe74f8b1bb8e837a39..6a81b17693fe3031d7ed3ab874bea09a6d625b94 100644 (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.
 
index 47f8b19935758fbf151baf39d4fa2548cbcc717a..c617d27fc652f9fb184b39d7dd1a7d9722775049 100644 (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
index 62780a08cc78d4274801115dac3eba89ff7b1011..7e4fa172ccd5fe38aa7e30a23cf27be76ca87617 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-Wl,-u,_printf_float" { target newlib_nano_io } } */
+
 #include <stdio.h>
 #include <stdarg.h>
 
index 4544471ec7db6b12f3d7c6beb5e2413b1fa37a39..f1630076800bd70c33d751e92686283e72d02f13 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-Wl,-u,_printf_float" { target newlib_nano_io } } */
+
 #include <stdio.h>
 char buf[2];
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/920810-1.x b/gcc/testsuite/gcc.c-torture/execute/ieee/920810-1.x
new file mode 100644 (file)
index 0000000..8edec73
--- /dev/null
@@ -0,0 +1,4 @@
+if { [check_effective_target_newlib_nano_io] } {
+    lappend additional_flags "-Wl,-u,_printf_float"
+}
+return 0
index 6f8b7a9fb1b70a34404fbce1c910cc4957e860c9..5684fd704aeebebfb18500ca6a8864abf0bf8ea5 100644 (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)
index fe7169158e48c477b7f6c87bf488c8929e5822bb..7bfd5c32354273f815c7d6866a6a3fd1f2fadccb 100644 (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.