9front - general discussion about 9front
 help / color / mirror / Atom feed
From: ori@eigenstate.org
To: 9front@9front.org
Subject: Re: [9front] [PATCH] cc: take our pickle out of the peephole
Date: Sun, 02 Oct 2022 14:08:49 -0400	[thread overview]
Message-ID: <4EBB293605FE50837A85CFB227F07E7A@eigenstate.org> (raw)
In-Reply-To: <YzjK7Dv+bqcJVS1h@alice>

Quoth Anthony Martin <ality@pbrane.org>:
> 
> The -P flag is used to debug the peephole optimizer. The -Z flag is
> used to output pickling code for various types. Don't confuse the two.
> 
> The pickling code was added in the third edition. It mistakenly reused
> the -P flag which was later partially corrected to use the -Z flag in
> 2004. That change updated lex.c but missed the code in pickle.c.
> 
> ---
> diff 7bf177b3e058925265863979ee50e8dc1822d17a b44281c5cf3db0ca60a22df94bbe99e8bcf9c9e3
> --- a/sys/src/cmd/cc/pickle.c	Tue Aug 23 04:38:49 2022
> +++ b/sys/src/cmd/cc/pickle.c	Sat Oct 1 15:48:00 2022
> @@ -172,9 +172,9 @@
>  	int n;
>  	char *an;
> 
> -	if(!debug['P'])
> +	if(!debug['Z'])
>  		return;
> -	if(debug['P'] > 1) {
> +	if(debug['Z'] > 1) {
>  		n = 0;
>  		for(i=iostack; i; i=i->link)
>  			n++;
> @@ -221,9 +221,9 @@
>  	Type *t;
>  	Sym *s1, *s2;
> 
> -	if(!debug['P'] || debug['s'])
> +	if(!debug['Z'] || debug['s'])
>  		return;
> -	if(debug['P'] > 1) {
> +	if(debug['Z'] > 1) {
>  		n = 0;
>  		for(i=iostack; i; i=i->link)
>  			n++;

looks good, done.

      parent reply	other threads:[~2022-10-02 18:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-01 23:19 Anthony Martin
2022-10-01 23:24 ` unobe
2022-10-13  0:34   ` Anthony Martin
2022-10-13  3:08     ` Noam Preil
2022-10-13  8:02       ` Steve Simon
2022-10-13  8:56         ` hiro
2022-10-02 18:08 ` ori [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=4EBB293605FE50837A85CFB227F07E7A@eigenstate.org \
    --to=ori@eigenstate.org \
    --cc=9front@9front.org \
    /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 NNTP newsgroup(s).