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
From 98b5359b474e4de89ebc1ea5203ca907738f7d7f Mon Sep 17 00:00:00 2001
From: Martin Liska <mli...@suse.cz>
Date: Wed, 12 Jan 2022 12:48:33 +0100
Subject: [PATCH] opts: do not do sanity check when an error is seen
PR target/103804
gcc/c-family/ChangeLog:
* c-attribs.c (handle_optimize_attribute): Do not call
cl_optimization_compare if we seen an error.
---
gcc/c-family/c-attribs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gcc/c-family/c-attribs.c b/gcc/c-family/c-attribs.c
index dbb892e0ec6..bdf72ce385c 100644
--- a/gcc/c-family/c-attribs.c
+++ b/gcc/c-family/c-attribs.c
@@ -5516,7 +5516,8 @@ handle_optimize_attribute (tree *node, tree name, tree args,
if (saved_global_options != NULL)
{
- cl_optimization_compare (saved_global_options, &global_options);
+ if (!seen_error ())
+ cl_optimization_compare (saved_global_options, &global_options);
free (saved_global_options);
}
}
--
2.34.1