From 98b5359b474e4de89ebc1ea5203ca907738f7d7f Mon Sep 17 00:00:00 2001 From: Martin Liska 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