public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin Liška" <mliska@suse.cz>
To: Jeff Law <jeffreyalaw@gmail.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] opts: do not do sanity check when an error is seen
Date: Wed, 12 Jan 2022 12:52:04 +0100	[thread overview]
Message-ID: <a3197c62-7540-bc47-bf65-02db5488a7c1@suse.cz> (raw)
In-Reply-To: <8eab30c4-0e56-7594-84c8-631be27df8ae@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 674 bytes --]

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

[-- Attachment #2: 0001-opts-do-not-do-sanity-check-when-an-error-is-seen.patch --]
[-- Type: text/x-patch, Size: 962 bytes --]

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


      reply	other threads:[~2022-01-12 11:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-16 14:37 Martin Liška
2021-12-16 16:44 ` Jeff Law
2022-01-12 11:52   ` Martin Liška [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a3197c62-7540-bc47-bf65-02db5488a7c1@suse.cz \
    --to=mliska@suse.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).