aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-expr.cc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2024-12-14 11:25:08 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2024-12-14 11:25:08 +0100
commit18f0b7d5f370c47633837e935f8a6e1b8616b56b (patch)
tree434f3af64dd27a189a2b6f73d0e327c23607f170 /gcc/fortran/trans-expr.cc
parenta6a15bc5b77c8703a95130f410a944f5408a5cc4 (diff)
downloadgcc-18f0b7d5f370c47633837e935f8a6e1b8616b56b.zip
gcc-18f0b7d5f370c47633837e935f8a6e1b8616b56b.tar.gz
gcc-18f0b7d5f370c47633837e935f8a6e1b8616b56b.tar.bz2
opts: Use OPTION_SET_P instead of magic value 2 for -fshort-enums default [PR118011]
The magic values for default (usually -1 or sometimes 2) for some options are from times we haven't global_options_set, I think we should eventually get rid of all of those. The PR is about gcc -Q --help=optimizers reporting -fshort-enums as [enabled] when it is disabled. For this the following patch is just partial fix; with explicit gcc -Q --help=optimizers -fshort-enums or gcc -Q --help=optimizers -fno-short-enums it already worked correctly before, with this patch it will report even with just gcc -Q --help=optimizers correct value on most targets, except 32-bit arm with some options or defaults, so I think it is a step in the right direction. But, as I wrote in the PR, process_options isn't done before --help= and even shouldn't be in its current form where it warns on some option combinations or errors or emits sorry on others, so I think ideally process_options should have some bool argument whether it is done for --help= purposes or not, if yes, not emit warnings and just adjust the options, otherwise do what it currently does. 2024-12-14 Jakub Jelinek <jakub@redhat.com> PR c/118011 gcc/ * opts.cc (init_options_struct): Don't set opts->x_flag_short_enums to 2. * toplev.cc (process_options): Test !OPTION_SET_P (flag_short_enums) rather than flag_short_enums == 2. gcc/ada/ * gcc-interface/misc.cc (gnat_post_options): Test !OPTION_SET_P (flag_short_enums) rather than flag_short_enums == 2.
Diffstat (limited to 'gcc/fortran/trans-expr.cc')
0 files changed, 0 insertions, 0 deletions