}
break;
+ case OPT_mabi_ibmlongdouble:
+ case OPT_mabi_ieeelongdouble:
+ if (opts->x_rs6000_long_double_type_size == 64)
+ {
+ error_at (loc, "option %<%s%> requires %<-mlong-double-128%>",
+ decoded->orig_option_with_args_text);
+ return true;
+ }
+ break;
+
case OPT_mrecip:
opts->x_rs6000_recip_name = (value) ? "default" : "none";
break;
; /* The option value can be seen when cl_target_option_restore is called. */
else if (rs6000_long_double_type_size == 128)
rs6000_long_double_type_size = FLOAT_PRECISION_TFmode;
- else if (OPTION_SET_P (rs6000_ieeequad))
- {
- if (global_options.x_rs6000_ieeequad)
- error ("%qs requires %qs", "-mabi=ieeelongdouble", "-mlong-double-128");
- else
- error ("%qs requires %qs", "-mabi=ibmlongdouble", "-mlong-double-128");
- }
/* Set -mabi=ieeelongdouble on some old targets. In the future, power server
systems will also set long double to be IEEE 128-bit. AIX and Darwin
if (!OPTION_SET_P (rs6000_ieeequad))
rs6000_ieeequad = TARGET_IEEEQUAD_DEFAULT;
- else
+ else if (TARGET_LONG_DOUBLE_128)
{
if (global_options.x_rs6000_ieeequad
&& (!TARGET_POPCNTD || !TARGET_VSX))
error ("%qs requires full ISA 2.06 support", "-mabi=ieeelongdouble");
- if (rs6000_ieeequad != TARGET_IEEEQUAD_DEFAULT && TARGET_LONG_DOUBLE_128)
+ if (rs6000_ieeequad != TARGET_IEEEQUAD_DEFAULT)
{
/* Determine if the user can change the default long double type at
compilation time. You need GLIBC 2.32 or newer to be able to
--- /dev/null
+/* PR target/104208 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mlong-double-128 -mabi=ibmlongdouble -mlong-double-64 -Wno-psabi" } */
+
+/* Verify we do not emit an error with the options above. It is allowed
+ to reset the long double size to 64-bits after a 128-bit long double
+ ABI has been selected. */
+
+int i;
--- /dev/null
+/* PR target/104208 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mlong-double-128 -mabi=ieeelongdouble -mlong-double-64 -mno-vsx -Wno-psabi" } */
+
+/* Verify we do not emit an error with the options above. IEEE 128-bit
+ long double requires VSX, so using -mno-vsx would normally generate
+ an error. However, if we have changed to a 64-bit long double, then
+ we should allow it. */
+
+int i;
/* PR target/87496 */
/* { dg-do compile { target { powerpc*-*-* } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
-/* { dg-options "-O2 -mdejagnu-cpu=power7 -mabi=ieeelongdouble -mlong-double-64 -Wno-psabi" } */
+/* { dg-options "-O2 -mdejagnu-cpu=power7 -mlong-double-64 -mabi=ieeelongdouble -Wno-psabi" } */
int i;
/* PR target/87496 */
/* { dg-do compile { target { powerpc*-*-* } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
-/* { dg-options "-O2 -mabi=ibmlongdouble -mlong-double-64 -Wno-psabi" } */
+/* { dg-options "-O2 -mlong-double-64 -mabi=ibmlongdouble -Wno-psabi" } */
int i;