[PATCH] PowerPC: Set long double size for IBM/IEEE.

Segher Boessenkool segher@kernel.crashing.org
Fri Dec 11 21:18:23 GMT 2020


Hi!

On Thu, Nov 19, 2020 at 07:00:11PM -0500, Michael Meissner wrote:
> --- a/gcc/config/rs6000/rs6000.c
> +++ b/gcc/config/rs6000/rs6000.c
> @@ -4131,8 +4131,13 @@ rs6000_option_override_internal (bool global_init_p)
>  
>    /* Use long double size to select the appropriate long double.  We use
>       TYPE_PRECISION to differentiate the 3 different long double types.  We map
> -     128 into the precision used for TFmode.  */
> -  int default_long_double_size = (RS6000_DEFAULT_LONG_DOUBLE_SIZE == 64
> +     128 into the precision used for TFmode.
> +
> +     If the user explicitly used -mabi=ieeelongdouble or -mabi=ibmlongdouble,
> +     but the compiler was configured for default 64-bit long doubles, set the
> +     long double to be 128.  */
> +  int default_long_double_size = ((RS6000_DEFAULT_LONG_DOUBLE_SIZE == 64
> +				   && !global_options_set.x_rs6000_ieeequad)
>  				  ? 64
>  				  : FLOAT_PRECISION_TFmode);

If you do a change like this, you need to change the name of the
variable.  As-is, is already is not very exact, but after this change
it is plain wrong.  "Default size is something else than the default
size if certain flags are set".


Segher


More information about the Gcc-patches mailing list