options: Save and restore opts_set for Optimization and Target options fallout
authorJakub Jelinek <jakub@redhat.com>
Mon, 5 Oct 2020 07:34:42 +0000 (09:34 +0200)
committerJakub Jelinek <jakub@redhat.com>
Mon, 5 Oct 2020 07:34:42 +0000 (09:34 +0200)
commit3c022a4c732163549ee999fb0b1846215cf0a671
tree881c19f8fc7f85c8916384113a63ff44ca79a5d3
parent21f65995e068963d4ceaec5b6730223213e98af7
options: Save and restore opts_set for Optimization and Target options fallout

> This breaks ia64:
>
> In file included from ./tm.h:23,
>                  from ../../gcc/gencheck.c:23:
> ./options.h:7816:40: error: ISO C++ forbids zero-size array 'explicit_mask' [-Werror=pedantic]
>  7816 |   unsigned HOST_WIDE_INT explicit_mask[0];
>       |                                        ^
> ./options.h:7816:26: error: zero-size array member 'cl_target_option::explicit_mask' not at end of 'struct cl_target_option' [-Werror=pedantic]
>  7816 |   unsigned HOST_WIDE_INT explicit_mask[0];
>       |                          ^~~~~~~~~~~~~
> ./options.h:7812:16: note: in the definition of 'struct cl_target_option'
>  7812 | struct GTY(()) cl_target_option
>       |                ^~~~~~~~~~~~~~~~

Oops, sorry.

The following patch should fix that and should also fix streaming of the
new explicit_mask_* members.

2020-10-05  Jakub Jelinek  <jakub@redhat.com>

* opth-gen.awk: Don't emit explicit_mask array if n_target_explicit
is equal to n_target_explicit_mask.
* optc-save-gen.awk: Compute has_target_explicit_mask and if false,
don't emit code iterating over explicit_mask array elements.  Stream
also explicit_mask_* target members.
gcc/optc-save-gen.awk
gcc/opth-gen.awk