From 4e3beaca15cab2de88a68d76f0aabc68e68f678a Mon Sep 17 00:00:00 2001 From: Prathamesh Kulkarni Date: Fri, 22 Jan 2021 14:14:20 +0530 Subject: [PATCH] arm: Fix ICE with incompatible values for -mfp16-format [PR98636]. gcc/ 2021-01-22 Prathamesh Kulkarni PR target/98636 * optc-save-gen.awk: Add arm_fp16_format to checked_options. gcc/testsuite/ 2021-01-22 Prathamesh Kulkarni PR target/98636 * gcc.target/arm/pr98636.c: New test. --- gcc/optc-save-gen.awk | 2 ++ gcc/testsuite/gcc.target/arm/pr98636.c | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100644 gcc/testsuite/gcc.target/arm/pr98636.c diff --git a/gcc/optc-save-gen.awk b/gcc/optc-save-gen.awk index b1f85928275..b9c7187a3b9 100644 --- a/gcc/optc-save-gen.awk +++ b/gcc/optc-save-gen.awk @@ -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 index 00000000000..c4d235cb43d --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/pr98636.c @@ -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 -- 2.30.2