public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* PowerPC: Allow C/C++ to change long double type on GLIBC 2.32.
@ 2020-10-22 22:15 Michael Meissner
  2020-10-26 22:48 ` will schmidt
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Meissner @ 2020-10-22 22:15 UTC (permalink / raw)
  To: gcc-patches, Michael Meissner, Segher Boessenkool,
	David Edelsohn, Bill Schmidt, Peter Bergner, Jeff Law,
	Jonathan Wakely

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: PowerPC: Allow C/C++ to change long double type on GLIBC 2.32.
  2020-10-22 22:15 PowerPC: Allow C/C++ to change long double type on GLIBC 2.32 Michael Meissner
@ 2020-10-26 22:48 ` will schmidt
  2020-10-29 17:05   ` Michael Meissner
  0 siblings, 1 reply; 6+ messages in thread
From: will schmidt @ 2020-10-26 22:48 UTC (permalink / raw)
  To: Michael Meissner, gcc-patches, Segher Boessenkool,
	David Edelsohn, Bill Schmidt, Peter Bergner, Jeff Law,
	Jonathan Wakely

On Thu, 2020-10-22 at 18:15 -0400, Michael Meissner via Gcc-patches wrote:
> 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;

Does this need to be added back elsewhere? 



>  	      if (TARGET_IEEEQUAD)
>  		warning (OPT_Wpsabi, "Using IEEE extended precision "
>  			 "%<long double%>");
> -- 
> 2.22.0
> 
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: PowerPC: Allow C/C++ to change long double type on GLIBC 2.32.
  2020-10-26 22:48 ` will schmidt
@ 2020-10-29 17:05   ` Michael Meissner
  2020-10-29 19:11     ` will schmidt
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Meissner @ 2020-10-29 17:05 UTC (permalink / raw)
  To: will schmidt
  Cc: Michael Meissner, gcc-patches, Segher Boessenkool,
	David Edelsohn, Bill Schmidt, Peter Bergner, Jeff Law,
	Jonathan Wakely

On Mon, Oct 26, 2020 at 05:48:48PM -0500, will schmidt wrote:
> On Thu, 2020-10-22 at 18:15 -0400, Michael Meissner via Gcc-patches wrote:
> > 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;
> 
> Does this need to be added back elsewhere? 

At the present time, we are not contemplating adding the full support to enable
configuring GCC to use IEEE 128-bit long double in GCC 10 or earlier.  This may
change depending on customer demands.

-- 
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: PowerPC: Allow C/C++ to change long double type on GLIBC 2.32.
  2020-10-29 17:05   ` Michael Meissner
@ 2020-10-29 19:11     ` will schmidt
  2020-10-29 20:08       ` Segher Boessenkool
  0 siblings, 1 reply; 6+ messages in thread
From: will schmidt @ 2020-10-29 19:11 UTC (permalink / raw)
  To: Michael Meissner
  Cc: gcc-patches, Segher Boessenkool, David Edelsohn, Bill Schmidt,
	Peter Bergner, Jeff Law, Jonathan Wakely

On Thu, 2020-10-29 at 13:05 -0400, Michael Meissner wrote:
> On Mon, Oct 26, 2020 at 05:48:48PM -0500, will schmidt wrote:
> > On Thu, 2020-10-22 at 18:15 -0400, Michael Meissner via Gcc-patches 
> > wrote:
> > > 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;
> > 
> > Does this need to be added back elsewhere? 
> 
> At the present time, we are not contemplating adding the full support
> to enable
> configuring GCC to use IEEE 128-bit long double in GCC 10 or
> earlier.  This may
> change depending on customer demands.
> 

My question was/is specific with the removal of the assignment

-	      warned_change_long_double = true;

I didn't see where that line or an equvalent was added back.  It's
either set elsewhere (ok), or no longer used.

Thanks,
-Will




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: PowerPC: Allow C/C++ to change long double type on GLIBC 2.32.
  2020-10-29 19:11     ` will schmidt
@ 2020-10-29 20:08       ` Segher Boessenkool
  2020-10-29 20:55         ` Michael Meissner
  0 siblings, 1 reply; 6+ messages in thread
From: Segher Boessenkool @ 2020-10-29 20:08 UTC (permalink / raw)
  To: will schmidt
  Cc: Michael Meissner, gcc-patches, David Edelsohn, Bill Schmidt,
	Peter Bergner, Jeff Law, Jonathan Wakely

On Thu, Oct 29, 2020 at 02:11:47PM -0500, will schmidt wrote:
> On Thu, 2020-10-29 at 13:05 -0400, Michael Meissner wrote:
> > On Mon, Oct 26, 2020 at 05:48:48PM -0500, will schmidt wrote:
> > > On Thu, 2020-10-22 at 18:15 -0400, Michael Meissner via Gcc-patches 
> > > wrote:
> > > > 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;
> > > 
> > > Does this need to be added back elsewhere? 
> > 
> > At the present time, we are not contemplating adding the full support
> > to enable
> > configuring GCC to use IEEE 128-bit long double in GCC 10 or
> > earlier.  This may
> > change depending on customer demands.
> > 
> 
> My question was/is specific with the removal of the assignment
> 
> -	      warned_change_long_double = true;
> 
> I didn't see where that line or an equvalent was added back.  It's
> either set elsewhere (ok), or no longer used.

It isn't set anywhere else.

Mike, the patch is okay for trunk with that line restored.  Thanks!
(And thanks for spotting the problem Will!)


Segher

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: PowerPC: Allow C/C++ to change long double type on GLIBC 2.32.
  2020-10-29 20:08       ` Segher Boessenkool
@ 2020-10-29 20:55         ` Michael Meissner
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Meissner @ 2020-10-29 20:55 UTC (permalink / raw)
  To: Segher Boessenkool
  Cc: will schmidt, Michael Meissner, gcc-patches, David Edelsohn,
	Bill Schmidt, Peter Bergner, Jeff Law, Jonathan Wakely

On Thu, Oct 29, 2020 at 03:08:07PM -0500, Segher Boessenkool wrote:
> It isn't set anywhere else.
> 
> Mike, the patch is okay for trunk with that line restored.  Thanks!
> (And thanks for spotting the problem Will!)

It is set since the variable is a static.  The whole point is to only raise the
error once, even if the options code gets called multiple times.

Ah right, it got missed.  Thanks.

-- 
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-10-29 20:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-22 22:15 PowerPC: Allow C/C++ to change long double type on GLIBC 2.32 Michael Meissner
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

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).