public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Xi Ruoyao <xry111@xry111.site>
To: Lulu Cheng <chenglulu@loongson.cn>, gcc-patches@gcc.gnu.org
Cc: Wang Xuerui <i@xen0n.name>, Chenghua Xu <xuchenghua@loongson.cn>
Subject: Re: [PATCH] LoongArch: fix signed overflow in loongarch_emit_int_compare
Date: Sun, 06 Nov 2022 16:00:41 +0800	[thread overview]
Message-ID: <134d3dbb253e69095501176e12b5585b28d2b00d.camel@xry111.site> (raw)
In-Reply-To: <9ed0e1ee-00da-a9e8-8c13-552b172fa08c@loongson.cn>

On Sun, 2022-11-06 at 09:46 +0800, Lulu Cheng wrote:
> I think it should be here:
> 
>               if (!increment && !decrement)
>                  continue;
> 
> +             if ((increment && rhs == HOST_WIDE_INT_MAX)
> +                 || (decrement && rhs == HOST_WIDE_INT_MIN))
> +               break;
> +
> 
> It is not necessary to continue when *code matches one of 
> mag_comparisons[i].

Ah yes, I misread the code :(.

-- 
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University

      reply	other threads:[~2022-11-06  8:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04  6:39 Xi Ruoyao
2022-11-06  1:46 ` Lulu Cheng
2022-11-06  8:00   ` Xi Ruoyao [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=134d3dbb253e69095501176e12b5585b28d2b00d.camel@xry111.site \
    --to=xry111@xry111.site \
    --cc=chenglulu@loongson.cn \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=i@xen0n.name \
    --cc=xuchenghua@loongson.cn \
    /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).