opts: do not do sanity check when an error is seen
authorMartin Liska <mliska@suse.cz>
Wed, 12 Jan 2022 11:48:33 +0000 (12:48 +0100)
committerMartin Liska <mliska@suse.cz>
Wed, 12 Jan 2022 11:52:19 +0000 (12:52 +0100)
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

index dbb892e..bdf72ce 100644 (file)
@@ -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);
        }
     }