arm: Fix ICE with incompatible values for -mfp16-format [PR98636].
authorPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
Fri, 22 Jan 2021 08:44:20 +0000 (14:14 +0530)
committerPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
Fri, 22 Jan 2021 08:44:20 +0000 (14:14 +0530)
gcc/
2021-01-22  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

PR target/98636
* optc-save-gen.awk: Add arm_fp16_format to checked_options.

gcc/testsuite/
2021-01-22  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

PR target/98636
* gcc.target/arm/pr98636.c: New test.

gcc/optc-save-gen.awk
gcc/testsuite/gcc.target/arm/pr98636.c [new file with mode: 0644]

index b1f8592827520c9869650908f08b144452587600..b9c7187a3b9a63014010a03d545bcc6850f1bc10 100644 (file)
@@ -1443,6 +1443,8 @@ checked_options["unroll_only_small_loops"]++
 checked_options["TARGET_ALIGN_CALL"]++
 checked_options["TARGET_CASE_VECTOR_PC_RELATIVE"]++
 checked_options["arc_size_opt_level"]++
+# arm exceptions
+checked_options["arm_fp16_format"]++
 
 for (i = 0; i < n_opts; i++) {
        name = var_name(flags[i]);
diff --git a/gcc/testsuite/gcc.target/arm/pr98636.c b/gcc/testsuite/gcc.target/arm/pr98636.c
new file mode 100644 (file)
index 0000000..c4d235c
--- /dev/null
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-mfp16-format=alternative" } */
+
+#pragma GCC push_options
+# pragma GCC target ("arch=armv8.2-a+fp16") /* { dg-error "selected fp16 options are incompatible" } */
+#pragma GCC pop_options