public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Michael Meissner <meissner@linux.ibm.com>
To: Michael Meissner <meissner@linux.ibm.com>,
	gcc-patches@gcc.gnu.org,
	Segher Boessenkool <segher@kernel.crashing.org>,
	David Edelsohn <dje.gcc@gmail.com>,
	Bill Schmidt <wschmidt@linux.ibm.com>,
	Peter Bergner <bergner@linux.ibm.com>,
	Joseph Myers <joseph@codesourcery.com>
Subject: [PATCH 1/3 V2] Fix __sprintfkf prototype in libgcc.
Date: Mon, 1 Mar 2021 12:17:34 -0500	[thread overview]
Message-ID: <20210301171734.GA9185@ibm-toto.the-meissners.org> (raw)
In-Reply-To: <20210301171432.GA7962@ibm-toto.the-meissners.org>

[PATCH 1/3 V2] Fix __sprintfkf prototype in libgcc.

The prototype of __sprintfkf in _sprintfkf.h did not match the function in
_sprintfkf.c.  This patch fixes the prototype.  I also included the
_sprintfkf.h file in _sprintfkf.c to make sure the prototype is correct and to
eliminate a warning about declaring the function without a previous
declaration.

I have done bootstraps on a little endian power9 system with each of the long
double variants (128-bit IBM, 128-bit IEEE, 64-bit) enabled, and there were no
regressions in each of the builds with the previous version.

In addition, I have built 2 cross compilers from my x86_64 system to little
endian PowerPC Linux.  One build enabled decimal support and one disabled the
decimal support.  On the build that disabled decimal support, I verified that
the _Float128 <-> Decimal conversions were not built.

Can I check this patch into the master branch for GCC 11?

libgcc/
2021-03-01  Michael Meissner  <meissner@linux.ibm.com>

	* config/rs6000/_sprintfkf.h (__sprintfkf): Fix prototype to match
	the function.
	* config/rs6000/_sprintfkf.c: Include _sprintfkf.h.
---
 libgcc/config/rs6000/_sprintfkf.c | 1 +
 libgcc/config/rs6000/_sprintfkf.h | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libgcc/config/rs6000/_sprintfkf.c b/libgcc/config/rs6000/_sprintfkf.c
index a7fdfb483c9..2d624f14e25 100644
--- a/libgcc/config/rs6000/_sprintfkf.c
+++ b/libgcc/config/rs6000/_sprintfkf.c
@@ -28,6 +28,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #include <soft-fp.h>
 #include <quad-float128.h>
 #include <stdio.h>
+#include <_sprintfkf.h>
 
 /* This function must be built with IBM 128-bit as long double, so that we can
    access the strfroml function if do not have an IEEE 128-bit version, and if
diff --git a/libgcc/config/rs6000/_sprintfkf.h b/libgcc/config/rs6000/_sprintfkf.h
index 637d104c882..de9d7137f69 100644
--- a/libgcc/config/rs6000/_sprintfkf.h
+++ b/libgcc/config/rs6000/_sprintfkf.h
@@ -24,5 +24,4 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 /* Declaration of the conversion function to IEEE 128-bit floating point from
    string using snprintf.  */
 
-extern int __sprintfkf (char *restrict, const char *restrict, ...);
-
+extern int __sprintfkf (char *restrict, const char *restrict, _Float128);
-- 
2.22.0


-- 
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meissner@linux.ibm.com, phone: +1 (978) 899-4797

  reply	other threads:[~2021-03-01 17:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-01 17:14 [PATCH 0/3 V2] Honor --disable-decimal-float in PowerPC libgcc _Float128 Michael Meissner
2021-03-01 17:17 ` Michael Meissner [this message]
2021-03-01 22:37   ` [PATCH 1/3 V2] Fix __sprintfkf prototype in libgcc Segher Boessenkool
2021-03-01 17:18 ` [PATCH 2/3 V2] Do not include stdio.h in libgcc's Decimal/Float128 conversions Michael Meissner
2021-03-01 23:15   ` Segher Boessenkool
2021-03-02 21:25     ` Michael Meissner
2021-03-02 21:53       ` Segher Boessenkool
2021-03-03 19:12         ` Michael Meissner
2021-03-03 23:33           ` Joseph Myers
2021-03-04  1:01             ` Michael Meissner
2021-03-09 18:35           ` Segher Boessenkool
2021-03-01 17:19 ` [PATCH 3/3 V2] Do not build Decimal/Float128 conversions if decimal is disabled Michael Meissner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210301171734.GA9185@ibm-toto.the-meissners.org \
    --to=meissner@linux.ibm.com \
    --cc=bergner@linux.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    --cc=segher@kernel.crashing.org \
    --cc=wschmidt@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).