re PR target/87496 (ICE in aggregate_value_p at gcc/function.c:2046)
authorPeter Bergner <bergner@linux.ibm.com>
Fri, 7 Dec 2018 17:33:55 +0000 (17:33 +0000)
committerPeter Bergner <bergner@gcc.gnu.org>
Fri, 7 Dec 2018 17:33:55 +0000 (11:33 -0600)
gcc/
PR target/87496
* config/rs6000/rs6000.c (rs6000_option_override_internal): Disallow
-mabi=ieeelongdouble and -mabi=ibmlongdouble without -mlong-double-128.
Do not error for -mabi=ibmlongdouble and no ISA 2.06 support.
* doc/invoke.texi: Document -mabi=ibmlongdouble and -mabi=ieeelongdouble
require -mlong-double-128.

gcc/testsuite/
PR target/87496
* gcc.target/powerpc/pr87496.c: Rename from this...
* gcc.target/powerpc/pr87496-1.c: ...to this.  Update comment.
* gcc.target/powerpc/pr87496-2.c: New test.
* gcc.target/powerpc/pr87496-3.c: New test.

From-SVN: r266899

gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/pr87496-1.c [moved from gcc/testsuite/gcc.target/powerpc/pr87496.c with 94% similarity]
gcc/testsuite/gcc.target/powerpc/pr87496-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/pr87496-3.c [new file with mode: 0644]

index 41fb2da..f99d9dd 100644 (file)
@@ -1,3 +1,12 @@
+2018-12-07  Peter Bergner  <bergner@linux.ibm.com>
+
+       PR target/87496
+       * config/rs6000/rs6000.c (rs6000_option_override_internal): Disallow
+       -mabi=ieeelongdouble and -mabi=ibmlongdouble without -mlong-double-128.
+       Do not error for -mabi=ibmlongdouble and no ISA 2.06 support.
+       * doc/invoke.texi: Document -mabi=ibmlongdouble and -mabi=ieeelongdouble
+       require -mlong-double-128.
+
 2018-12-07  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        * config/aarch64/aarch64.c (aarch64_tuning_override_functions): Add
index 91e0121..cd3fdd0 100644 (file)
@@ -4282,6 +4282,13 @@ rs6000_option_override_internal (bool global_init_p)
     }
   else if (rs6000_long_double_type_size == 128)
     rs6000_long_double_type_size = FLOAT_PRECISION_TFmode;
+  else if (global_options_set.x_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
@@ -4293,7 +4300,8 @@ rs6000_option_override_internal (bool global_init_p)
 
   else
     {
-      if (!TARGET_POPCNTD || !TARGET_VSX)
+      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)
index 98c1a74..dd262b6 100644 (file)
@@ -23932,7 +23932,8 @@ Change the current ABI to use IBM extended-precision long double.
 This is not likely to work if your system defaults to using IEEE
 extended-precision long double.  If you change the long double type
 from IEEE extended-precision, the compiler will issue a warning unless
-you use the @option{-Wno-psabi} option.
+you use the @option{-Wno-psabi} option.  Requires @option{-mlong-double-128}
+to be enabled.
 
 @item -mabi=ieeelongdouble
 @opindex mabi=ieeelongdouble
@@ -23940,7 +23941,8 @@ Change the current ABI to use IEEE extended-precision long double.
 This is not likely to work if your system defaults to using IBM
 extended-precision long double.  If you change the long double type
 from IBM extended-precision, the compiler will issue a warning unless
-you use the @option{-Wno-psabi} option.
+you use the @option{-Wno-psabi} option.  Requires @option{-mlong-double-128}
+to be enabled.
 
 @item -mabi=elfv1
 @opindex mabi=elfv1
@@ -25201,7 +25203,8 @@ Change the current ABI to use IBM extended-precision long double.
 This is not likely to work if your system defaults to using IEEE
 extended-precision long double.  If you change the long double type
 from IEEE extended-precision, the compiler will issue a warning unless
-you use the @option{-Wno-psabi} option.
+you use the @option{-Wno-psabi} option.  Requires @option{-mlong-double-128}
+to be enabled.
 
 @item -mabi=ieeelongdouble
 @opindex mabi=ieeelongdouble
@@ -25209,7 +25212,8 @@ Change the current ABI to use IEEE extended-precision long double.
 This is not likely to work if your system defaults to using IBM
 extended-precision long double.  If you change the long double type
 from IBM extended-precision, the compiler will issue a warning unless
-you use the @option{-Wno-psabi} option.
+you use the @option{-Wno-psabi} option.  Requires @option{-mlong-double-128}
+to be enabled.
 
 @item -mabi=elfv1
 @opindex mabi=elfv1
index 698a744..58b0ef3 100644 (file)
@@ -1,3 +1,11 @@
+2018-12-07  Peter Bergner  <bergner@linux.ibm.com>
+
+       PR target/87496
+       * gcc.target/powerpc/pr87496.c: Rename from this...
+       * gcc.target/powerpc/pr87496-1.c: ...to this.  Update comment.
+       * gcc.target/powerpc/pr87496-2.c: New test.
+       * gcc.target/powerpc/pr87496-3.c: New test.
+
 2018-12-07  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        * gcc.target/aarch64/sve/override_sve_width_1.c: New test.
similarity index 94%
rename from gcc/testsuite/gcc.target/powerpc/pr87496.c
rename to gcc/testsuite/gcc.target/powerpc/pr87496-1.c
index b2ebc46..37ca8bb 100644 (file)
@@ -1,4 +1,4 @@
-/* PR target/87496.c */
+/* PR target/87496 */
 /* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/pr87496-2.c b/gcc/testsuite/gcc.target/powerpc/pr87496-2.c
new file mode 100644 (file)
index 0000000..032c954
--- /dev/null
@@ -0,0 +1,9 @@
+/* PR target/87496 */
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } } */
+/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */
+/* { dg-options "-O2 -mcpu=power7 -mabi=ieeelongdouble -mlong-double-64 -Wno-psabi" } */
+
+int i;
+
+/* { dg-error "'-mabi=ieeelongdouble' requires '-mlong-double-128'" "PR87496" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.target/powerpc/pr87496-3.c b/gcc/testsuite/gcc.target/powerpc/pr87496-3.c
new file mode 100644 (file)
index 0000000..1be3997
--- /dev/null
@@ -0,0 +1,8 @@
+/* PR target/87496 */
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } } */
+/* { dg-options "-O2 -mabi=ibmlongdouble -mlong-double-64 -Wno-psabi" } */
+
+int i;
+
+/* { dg-error "'-mabi=ibmlongdouble' requires '-mlong-double-128'" "PR87496" { target *-*-* } 0 } */