diff options
author | Jakub Jelinek <jakub@redhat.com> | 2022-01-24 11:53:08 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2022-01-24 11:53:08 +0100 |
commit | 0ebb09f5e49c8ca06728bb791415d985df01f6d8 (patch) | |
tree | fd2d34460422d38f7cebe761717db774141c7887 /gcc/opt-functions.awk | |
parent | 9acd5a01175a3a0998eaaf306305890081d8550f (diff) | |
download | gcc-0ebb09f5e49c8ca06728bb791415d985df01f6d8.zip gcc-0ebb09f5e49c8ca06728bb791415d985df01f6d8.tar.gz gcc-0ebb09f5e49c8ca06728bb791415d985df01f6d8.tar.bz2 |
options: Add EnumBitSet property support [PR104158]
On Sat, Jan 22, 2022 at 01:47:08AM +0100, Jakub Jelinek via Gcc-patches wrote:
> I think with the 2) patch I achieve what we want for Fortran, for 1)
> the only behavior from gcc 11 is that
> -fsanitize-coverage=trace-cmp,trace-cmp is now rejected.
> This is mainly from the desire to disallow
> -fconvert=big-endian,little-endian or -Wbidi-chars=bidirectional,any
> etc. where it would be confusing to users what exactly it means.
> But it is the only from these options that actually acts as an Enum
> bit set, each enumerator can be specified with all the others.
> So one option would be stop requiring the EnumSet implies Set properties
> must be specified and just require that either they are specified on all
> EnumValues, or on none of them; the latter case would be for
> -fsanitize-coverage= and the non-Set case would mean that all the
> EnumValues need to have disjoint Value bitmasks and that they can
> be all specified and unlike the Set case also repeated.
> Thoughts on this?
Here is an incremental patch to the first two patches of the series
that implements EnumBitSet that fully restores the -fsanitize-coverage
GCC 11 behavior.
2022-01-24 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/104158
* opt-functions.awk (var_set): Handle EnumBitSet property.
* optc-gen.awk: Don't disallow RejectNegative if EnumBitSet is
specified.
* opts.h (enum cl_enum_var_value): New type.
* opts-common.cc (decode_cmdline_option): Use CLEV_* values.
Handle CLEV_BITSET.
(cmdline_handle_error): Handle CLEV_BITSET.
* opts.cc (test_enum_sets): Also test EnumBitSet requirements.
* doc/options.texi (EnumBitSet): Document.
* common.opt (fsanitize-coverage=): Use EnumBitSet instead of
EnumSet.
(trace-pc, trace-cmp): Drop Set properties.
* gcc.dg/sancov/pr104158-7.c: Adjust for repeating of arguments
being allowed.
Diffstat (limited to 'gcc/opt-functions.awk')
-rw-r--r-- | gcc/opt-functions.awk | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/opt-functions.awk b/gcc/opt-functions.awk index b2b11be..5b0bc66 100644 --- a/gcc/opt-functions.awk +++ b/gcc/opt-functions.awk @@ -298,9 +298,11 @@ function var_set(flags) if (flag_set_p("Enum.*", flags)) { en = opt_args("Enum", flags); if (flag_set_p("EnumSet", flags)) - return enum_index[en] ", CLVC_ENUM, 1" + return enum_index[en] ", CLVC_ENUM, CLEV_SET" + else if (flag_set_p("EnumBitSet", flags)) + return enum_index[en] ", CLVC_ENUM, CLEV_BITSET" else - return enum_index[en] ", CLVC_ENUM, 0" + return enum_index[en] ", CLVC_ENUM, CLEV_NORMAL" } if (var_type(flags) == "const char *") return "0, CLVC_STRING, 0" |