diff mbox series

opts: do not do sanity check when an error is seen

Message ID 965326f3-3658-f7d0-c5d8-a89a0d16d740@suse.cz
State New
Headers show
Series opts: do not do sanity check when an error is seen | expand

Commit Message

Martin Liška Dec. 16, 2021, 2:37 p.m. UTC
Do not check global options modification when an error is seen in parsing
of options (pragmas or attributes).

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

Ready to be installed?
Thanks,
Martin

	PR target/103709

gcc/c-family/ChangeLog:

	* c-pragma.c (handle_pragma_pop_options): Do not check
	global options modification when an error is seen in parsing
	of options (pragmas or attributes).
---
  gcc/c-family/c-pragma.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jeff Law Dec. 16, 2021, 4:44 p.m. UTC | #1
On 12/16/2021 7:37 AM, Martin Liška wrote:
> Do not check global options modification when an error is seen in parsing
> of options (pragmas or attributes).
>
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
>
> Ready to be installed?
> Thanks,
> Martin
>
>     PR target/103709
>
> gcc/c-family/ChangeLog:
>
>     * c-pragma.c (handle_pragma_pop_options): Do not check
>     global options modification when an error is seen in parsing
>     of options (pragmas or attributes).
OK
jeff
Martin Liška Jan. 12, 2022, 11:52 a.m. UTC | #2
On 12/16/21 17:44, Jeff Law wrote:
> 
> 
> On 12/16/2021 7:37 AM, Martin Liška wrote:
>> Do not check global options modification when an error is seen in parsing
>> of options (pragmas or attributes).
>>
>> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
>>
>> Ready to be installed?
>> Thanks,
>> Martin
>>
>>     PR target/103709
>>
>> gcc/c-family/ChangeLog:
>>
>>     * c-pragma.c (handle_pragma_pop_options): Do not check
>>     global options modification when an error is seen in parsing
>>     of options (pragmas or attributes).
> OK
> jeff
> 

The following patch handled the same for attributes.

Pushed as obvious.
Martin
diff mbox series

Patch

diff --git a/gcc/c-family/c-pragma.c b/gcc/c-family/c-pragma.c
index c4ed4205820..0772c34342a 100644
--- a/gcc/c-family/c-pragma.c
+++ b/gcc/c-family/c-pragma.c
@@ -1132,7 +1132,7 @@  handle_pragma_pop_options (cpp_reader *ARG_UNUSED(dummy))
  				      p->optimize_binary);
        optimization_current_node = p->optimize_binary;
      }
-  if (flag_checking)
+  if (flag_checking && !seen_error ())
      {
        cl_optimization_compare (p->saved_global_options, &global_options);
        free (p->saved_global_options);