public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Michael Meissner <meissner@linux.ibm.com>
To: gcc-patches@gcc.gnu.org,
	Michael Meissner <meissner@linux.ibm.com>,
	Segher Boessenkool <segher@kernel.crashing.org>,
	David Edelsohn <dje.gcc@gmail.com>,
	Bill Schmidt <wschmidt@linux.ibm.com>,
	Peter Bergner <bergner@linux.ibm.com>, Jeff Law <law@redhat.com>,
	Jonathan Wakely <jwakely@redhat.com>
Subject: PowerPC: Allow C/C++ to change long double type on GLIBC 2.32.
Date: Thu, 22 Oct 2020 18:15:47 -0400	[thread overview]
Message-ID: <20201022221547.GA12469@ibm-toto.the-meissners.org> (raw)

PowerPC: Allow C/C++ to change long double type on GLIBC 2.32.

This is a new patch.  It turns off the warning about switching the long double
type via compile line if the GLIBC is 2.32 or newer.  It only does this if the
languages are C or C++, since those language libraries support switching the
long double type.  Other languages like Fortran don't have any current support
to provide both sets of interfaces to the library.

2020-10-21  Michael Meissner  <meissner@linux.ibm.com>

	* config/rs6000/rs6000.c (rs6000_option_override_internal): Allow
	long double type to be changed for C/C++ if glibc 2.32 or newer.
---
 gcc/config/rs6000/rs6000.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 50039c0a53d..940c15f3265 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -4158,10 +4158,16 @@ rs6000_option_override_internal (bool global_init_p)
 
       if (rs6000_ieeequad != TARGET_IEEEQUAD_DEFAULT && TARGET_LONG_DOUBLE_128)
 	{
+	  /* Determine if the user can change the default long double type at
+	     compilation time.  Only C and C++ support this, and you need GLIBC
+	     2.32 or newer.  Only issue one warning.  */
 	  static bool warned_change_long_double;
-	  if (!warned_change_long_double)
+
+	  if (!warned_change_long_double
+	      && (!OPTION_GLIBC
+		  || (!lang_GNU_C () && !lang_GNU_CXX ())
+		  || ((TARGET_GLIBC_MAJOR * 1000) + TARGET_GLIBC_MINOR) < 2032))
 	    {
-	      warned_change_long_double = true;
 	      if (TARGET_IEEEQUAD)
 		warning (OPT_Wpsabi, "Using IEEE extended precision "
 			 "%<long double%>");
-- 
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:[~2020-10-22 22:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-22 22:15 Michael Meissner [this message]
2020-10-26 22:48 ` will schmidt
2020-10-29 17:05   ` Michael Meissner
2020-10-29 19:11     ` will schmidt
2020-10-29 20:08       ` Segher Boessenkool
2020-10-29 20:55         ` 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=20201022221547.GA12469@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=jwakely@redhat.com \
    --cc=law@redhat.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).