[gcc r12-6519] opts: do not do sanity check when an error is seen

Martin Liska marxin@gcc.gnu.org
Wed Jan 12 11:53:01 GMT 2022


https://gcc.gnu.org/g:4960516df2f90e6ae16aa03c63c8bf2c702e6bc4

commit r12-6519-g4960516df2f90e6ae16aa03c63c8bf2c702e6bc4
Author: Martin Liska <mliska@suse.cz>
Date:   Wed Jan 12 12:48:33 2022 +0100

    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.

Diff:
---
 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);
 	}
     }


More information about the Gcc-cvs mailing list